hackedteam/vector-edk

View on GitHub
vector-uefi/fd/tool/chipsec/module.py

Summary

Maintainability
A
2 hrs
Test Coverage

Function get_module_object has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def get_module_object(self):
        result = ModuleResult.PASSED
        if self.mod_obj == None :
            try:
                if _importlib:
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/module.py - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function do_import has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def do_import(self):
        loaded = False
        if not MODPATH_RE.match(self.get_name()):
            self.logger.error( "Invalid module path: %s" % self.name )
        else:
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/module.py - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def run( self, module_argv ):
        result = self.get_module_object()

        if self.mod_obj != None and result == ModuleResult.PASSED:
            if module_argv is not None:
Severity: Minor
Found in vector-uefi/fd/tool/chipsec/module.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

There are no issues that match your filters.

Category
Status