MCPcopy Index your code
hub / github.com/python/mypy / detect_possibly_undefined_vars

Method detect_possibly_undefined_vars

mypy/build.py:3454–3472  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3452 return result
3453
3454 def detect_possibly_undefined_vars(self) -> None:
3455 assert self.tree is not None, "Internal error: method must be called on parsed file only"
3456 if self.tree.is_stub:
3457 # We skip stub files because they aren't actually executed.
3458 return
3459 manager = self.manager
3460 manager.errors.set_file(self.xpath, self.tree.fullname, options=self.options)
3461 if manager.errors.is_error_code_enabled(
3462 codes.POSSIBLY_UNDEFINED
3463 ) or manager.errors.is_error_code_enabled(codes.USED_BEFORE_DEF):
3464 with self.wrap_context():
3465 self.tree.accept(
3466 PossiblyUndefinedVariableVisitor(
3467 MessageBuilder(manager.errors, manager.modules),
3468 self.type_map(),
3469 self.options,
3470 self.tree.names,
3471 )
3472 )
3473
3474 def finish_passes(self) -> None:
3475 assert self.tree is not None, "Internal error: method must be called on parsed file only"

Callers 3

process_stale_sccFunction · 0.80
update_module_isolatedFunction · 0.80

Calls 7

wrap_contextMethod · 0.95
type_mapMethod · 0.95
MessageBuilderClass · 0.90
set_fileMethod · 0.80
is_error_code_enabledMethod · 0.80
acceptMethod · 0.45

Tested by

no test coverage detected