Marcello-Sega/pytim

View on GitHub

Showing 85 of 713 total issues

Function _fit_circle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def _fit_circle(hr, hh, nonlinear=True):
        """ fit an arc through the profile h(r) sampled by the class

            :param list hr:        list of arrays with the radial coordinates
            :param list hh:        list of arrays with the elevations
Severity: Minor
Found in pytim/observables/contactangle.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 _center has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def _center(group, direction, halfbox_shift=False):
        """
        Centers the liquid slab in the simulation box.

        The algorithm tries to avoid problems with the definition
Severity: Minor
Found in pytim/interface.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 __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self,
Severity: Major
Found in pytim/simple_interface.py - About 1 hr to fix

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

    def __init__(self,
                 direction=None,
                 observable=None,
                 interface=None,
                 symmetry='default',
Severity: Minor
Found in pytim/observables/profile.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 center_system has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def center_system(symmetry, group, direction, planar_to_origin=False):
        if symmetry == 'planar':
            utilities.centerbox(group.universe, center_direction=direction)
            Interface._center(group, direction, halfbox_shift=True)
            utilities.centerbox(group.universe, center_direction=direction)
Severity: Minor
Found in pytim/interface.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 assign_universe has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def assign_universe(self, universe, analysis_group):
        """ Assign the universe and the analysis_group
        """
        self.interface._mode = self._check_universe(universe)
        if self.interface._mode is None:
Severity: Minor
Found in pytim/sanity_check.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 patchMDTRAJ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def patchMDTRAJ(trajectory, universe):
    """ Patch the mdtraj Trajectory class

        automates the data exchange between MDAnalysis and mdtraj classes

Severity: Minor
Found in pytim/patches.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 select_direction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def select_direction(self, arg):
        _dirs = {'x': 0, 'y': 1, 'z': 2}

        def _inarg(string, inp):
            return np.any([string in e for e in inp])
Severity: Minor
Found in pytim/observables/observable.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 compute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def compute(self, inp, kargs=None):
        """ Compute the local reference frame

            :param AtomGroup inp:  the group of atoms that define the surface
            :returns:              a (len(inp),3,3) set of coordinates defining
Severity: Minor
Found in pytim/observables/local_frame.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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self,
Severity: Major
Found in pytim/observables/profile.py - About 50 mins to fix

Function centerbox has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def centerbox(universe,
Severity: Major
Found in pytim/utilities.py - About 50 mins to fix

Function _assign_one_side has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _assign_one_side(self,
Severity: Major
Found in pytim/itim.py - About 50 mins to fix

Function write_file has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def write_file(filename,
Severity: Major
Found in pytim/cube.py - About 50 mins to fix

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

    def _compute_local_coords(self, box):
        local_coords = []
        for i, patch in enumerate(self.patches):
            p = self.tree.data[patch].copy()
            p = self.remove_pbc(p, box)
Severity: Minor
Found in pytim/observables/local_frame.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 assign_cluster_params has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def assign_cluster_params(self,
                              cluster_cut,
                              cluster_threshold_density,
                              extra_cluster_groups):
        elements = 0
Severity: Minor
Found in pytim/sanity_check.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 _fit_ellipse has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _fit_ellipse(x, y, nonlinear=True, off=0.0, points_density=25, verbose=False):
Severity: Minor
Found in pytim/observables/contactangle.py - About 45 mins to fix

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

    def _fit_ellipsoid(x, y, z, nonlinear=True, off=0.0, points_density=25):
        """  fit an ellipsoid through the points (x,y,z)

             :param list  x        : list of arrays with coordinates x
             :param list  y        : list of arrays with coordinates y
Severity: Minor
Found in pytim/observables/contactangle.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 _fit_ellipsoid has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _fit_ellipsoid(x, y, z, nonlinear=True, off=0.0, points_density=25):
Severity: Minor
Found in pytim/observables/contactangle.py - About 45 mins to fix

Function dont_skip_any_doctests has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def dont_skip_any_doctests(app, what, name, obj, skip, options):
Severity: Minor
Found in docs/source/conf.py - About 45 mins to fix

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

    def _remove_COM(self, group, inter, alpha, box):
        def group_size(g, direction):
            p = g.atoms.positions[:, direction]
            return np.abs(np.max(p) - np.min(p))

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

Severity
Category
Status
Source
Language