espressopp/espressopp

View on GitHub
src/System.py

Summary

Maintainability
B
4 hrs
Test Coverage

Function scaleVolume has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def scaleVolume(self, *args):
        if pmi.workerIsActive():
            if len(args) == 1:
                arg0 = args[0]
                if isinstance(arg0, Real3D):
Severity: Minor
Found in src/System.py - About 2 hrs 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 getInteraction has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def getInteraction(self, number):

        if pmi.workerIsActive():
            ni = self.getNumberOfInteractions()
            if ni > 0:
Severity: Minor
Found in src/System.py - About 45 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 addInteraction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def addInteraction(self, interaction, name=None):

        if pmi.workerIsActive():
            ret_val = self.cxxclass.addInteraction(self, interaction)
            if name is not None:
Severity: Minor
Found in src/System.py - About 25 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 getNameOfInteraction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def getNameOfInteraction(self, number):
        if pmi.workerIsActive():
            for name, iid in self._interaction2id.items():
                if iid == number:
                    return name
Severity: Minor
Found in src/System.py - About 25 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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self):

        if pmi._PMIComm and pmi._PMIComm.isActive():
            if pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup():
                cxxinit(self, _espressopp.System, pmi._PMIComm.getMPIsubcomm().py2f())
Severity: Minor
Found in src/System.py - About 25 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