Marcello-Sega/pytim

View on GitHub

Showing 85 of 713 total issues

Function _check_universe has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _check_universe(self, input_obj):
        """ Check whether instead of a universe,
            the input_obj is one of the following,
            and act accordingly:
            - MDAnalysis.core.universe.Universe
Severity: Minor
Found in pytim/sanity_check.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 get_values has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_values(self, binwidth=None, nbins=None):
        if self.sampled_values is None:
            print("Warning no profile sampled so far")
        # we use the largest box (largest number of bins) as reference.
        # Statistics will be poor at the boundaries, but like that we don't
Severity: Minor
Found in pytim/observables/profile.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 _guess_radii_from_types has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _guess_radii_from_types(interface, group, guessed):
    radii = np.copy(group.radii)

    _dict = interface.radii_dict
    for aname in np.unique(group.names):
Severity: Minor
Found in pytim/properties.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 compute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def compute(self, inp, kargs=None):
        """Compute the observable.

        :param ndarray inp:  the input atom group. The length must be a multiple
                             of three
Severity: Minor
Found in pytim/observables/orientation.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 assign_normal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def assign_normal(self, normal):
        interface = self.interface
        if not (interface.symmetry == 'planar'):
            raise ValueError(" wrong symmetry for normal assignement")
        if interface.analysis_group is None:
Severity: Minor
Found in pytim/sanity_check.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

Severity
Category
Status
Source
Language