Marcello-Sega/pytim

View on GitHub

Showing 85 of 713 total issues

Function label_group has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def label_group(self,
                    group,
                    beta=None,
                    layer=None,
                    cluster=None,
Severity: Minor
Found in pytim/interface.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 _compute_observable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _compute_observable(self, ka1, ka2):
        try:
            fg1 = self.observable.compute(self.g1, ka1)
        except:
            fg1 = self.observable.compute(self.g1)
Severity: Minor
Found in pytim/observables/rdf.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 write_atomgroup has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def write_atomgroup(filename, group, color=None, radius=None):
    """ write in a vtk file the positions of particles

        :param string filename: the filename
        :param AtomGroup group: the group, whose positions are to be written to
Severity: Minor
Found in pytim/vtk.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 correlate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def correlate(a1, a2=None, _normalize=True):
    """
      correlate data series using numpy fft. The function calculates \
      correlation or cross-correlation.

Severity: Minor
Found in pytim/utilities.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 _writepdb has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def _writepdb(interface,
Severity: Minor
Found in pytim/writepdb.py - About 45 mins to fix

Function _compute_observable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _compute_observable(self, ka1, ka2):
        try:
            fg1 = self.observable.compute(self.g1, ka1)
        except:
            fg1 = self.observable.compute(self.g1)
Severity: Minor
Found in pytim/observables/distributionfunction.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 writepdb has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def writepdb(self,
Severity: Minor
Found in pytim/interface.py - About 35 mins to fix

Function _remove_COM has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _remove_COM(self, group, inter, alpha, box):
Severity: Minor
Found in pytim/observables/contactangle.py - About 35 mins to fix

Function label_group has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def label_group(self,
Severity: Minor
Found in pytim/interface.py - About 35 mins to fix

Function _check_missing_attribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def _check_missing_attribute(interface, name, classname, group, value):
Severity: Minor
Found in pytim/properties.py - About 35 mins to fix

Function _touched_lines has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _touched_lines(self, atom, _x, _y, _z, _radius):
Severity: Minor
Found in pytim/itim.py - About 35 mins to fix

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

    def compute(self, inp1, inp2, reference_frame=None):
        # by adding a new axis we allow take the difference of positions
        # of the N inp atoms to the M reference_group ones.
        # pos here has dimension (N,M,3)

Severity: Minor
Found in pytim/observables/basic_observables.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

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

    def _contact_angles_from_ellipse(p, off=0.0):
        """  compute the contact angle from the parameters of the polynomial representation

             :parms array_like  p: a sequence (list, tuple, ndarray) of parameters of the ellipse equation\
                                      in general form:\
Severity: Minor
Found in pytim/observables/contactangle.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

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

    def label_planar_sides(self):
        """ Assign to all layers a label (the beta tempfactor)
            that can be used in pdb files. Additionally, set
            the new layers and sides.
        """
Severity: Minor
Found in pytim/interface.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

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

    def correlation(self, normalized=True, continuous=True):
        """ Calculate the autocorrelation from the sampled data

            :parameter bool normalized: normalize the correlation function to:
                                        its zero-time value for regular
Severity: Minor
Found in pytim/observables/correlator.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

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

def guess_radii(interface, group=None):
    # NOTE: this code depends on the assumption that not-set radii,
    # have the value np.nan (see _missing_attributes() ), so don't change it
    # let's test first which information is available
    guessed = {}
Severity: Minor
Found in pytim/properties.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

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

    def __init__(self,
                 universe,
                 group=None,
                 alpha=2.0,
                 normal='guess',
Severity: Minor
Found in pytim/gitim.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

Avoid too many return statements within this function.
Open

        return None
Severity: Major
Found in pytim/sanity_check.py - About 30 mins to fix

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

    def sample(self, g1=None, g2=None, kargs1=None, kargs2=None):
        kargs1 = kargs1 or {}
        kargs2 = kargs2 or {}
        self.n_frames += 1
        self.g2 = g2
Severity: Minor
Found in pytim/observables/rdf.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):
        try:
            pos = inp.atoms.positions
            pos = pos.flatten()
        except AttributeError:
Severity: Minor
Found in pytim/observables/basic_observables.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