Marcello-Sega/pytim

View on GitHub

Showing 84 of 573 total issues

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 fit_arc_ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def fit_arc_(z, r, rmin=None, rmax=None, use_points=False, p0=None):
Severity: Minor
Found in pytim/observables/contactangle.py - About 35 mins to fix

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

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

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

    def arc_function(self, r, rmin=0, rmax=None, use_points=False, base_cut=None):
Severity: Minor
Found in pytim/observables/contactangle.py - About 35 mins to fix

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

    def fit_points_ellipse(self, rmax=None, rmin=None, bins=None, yy=None, use_points=False):
Severity: Minor
Found in pytim/observables/contactangle.py - About 35 mins to fix

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

        def sample_theta_R(self, bins, th_left, th_right, RR_left, RR_right):
Severity: Minor
Found in pytim/observables/contactangle.py - About 35 mins to fix

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

    def sample(self, bins=100, params=None, binning='theta', periodic=None, base_cut=0.0):
Severity: Minor
Found in pytim/observables/contactangle.py - About 35 mins to fix

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

    def sample_theta_R(self, bins, theta, r, z, base_cut):
Severity: Minor
Found in pytim/observables/contactangle.py - About 35 mins to fix

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 _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 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 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 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 __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

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

    def sample(self, inter, bins=100, cut=3.5, alpha=2.5, pdbOut=None, binning='theta', periodic=None, removeCOM=None, base_cut=0.0):
        """ compute the height profile z(r) of a droplet

            :param int       bins     : number of slices along the z axis (across the whole box z-edge)
            :param float     cut      : cut-off for the clustering algorithm that separates liquid from vapor
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 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

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 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

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 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