def check_for_spaces_in_resource_names(self):
        """Validates that resource names do not contain spaces

        If `DEBUG` flag is `False`, logs only first bad model name
        If `DEBUG` flag is `True`, logs every bad model name
        If `REQUIRE_RESOURCE_NAMES_WITHOUT_SPACES` is `True`, logs are `ERROR` level and an exception is raised if any names are bad
        If `REQUIRE_RESOURCE_NAMES_WITHOUT_SPACES` is `False`, logs are `WARN` level
        """
        improper_resource_names = 0
        level = (
            EventLevel.ERROR
            if self.root_project.args.REQUIRE_RESOURCE_NAMES_WITHOUT_SPACES
            else EventLevel.WARN
        )

        flags = get_flags()

        for node in self.manifest.nodes.values():
            if " " in node.name:
                if improper_resource_names == 0 or flags.DEBUG:
                    fire_event(
                        SpacesInResourceNameDeprecation(
                            unique_id=node.unique_id,
                            level=level.value,
                        ),
                        level=level,
                    )
                improper_resource_names += 1

        if improper_resource_names > 0:
            if level == EventLevel.WARN:
                dbt.deprecations.warn(
                    "resource-names-with-spaces",
                    count_invalid_names=improper_resource_names,
                    show_debug_hint=(not flags.DEBUG),
                )
            else:  # ERROR level
                raise DbtValidationError("Resource names cannot contain spaces")
Validates that resource names do not contain spaces

        If `DEBUG` flag is `False`, logs only first bad model name
        If `DEBUG` flag is `True`, logs every bad model name
        If `REQUIRE_RESOURCE_NAMES_WITHOUT_SPACES` is `True`, logs are `ERROR` level and an exception is raised if any names are bad
        If `REQUIRE_RESOURCE_NAMES_WITHOUT_SPACES` is `False`, logs are `WARN` level
        
core/dbt/parser/manifest.py