Marcello-Sega/pytim

View on GitHub

Showing 85 of 713 total issues

Function __init__ has 17 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self,
Severity: Major
Found in pytim/itim.py - About 2 hrs to fix

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

    def _define_cluster_group(self):
        self.universe.atoms.pack_into_box()
        self.cluster_group = self.universe.atoms[:0]  # empty
        if (self.cluster_cut is not None):
            cluster_cut = float(self.cluster_cut[0])
Severity: Minor
Found in pytim/interface.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 _atom_coverage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def _atom_coverage(self, index):
        # derivation follows http://freesasa.github.io/doxygen/Geometry.html
        group = self.sasa_group
        box = group.universe.dimensions[:3]
        R = group.radii[index]
Severity: Minor
Found in pytim/sasa.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 patchTrajectory has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def patchTrajectory(trajectory, interface):
    """ Patch the MDAnalysis trajectory class

        this patch makes the layer assignement being automatically
        called whenever a new frame is loaded.
Severity: Minor
Found in pytim/patches.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

File surface.py has 251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4

from __future__ import print_function
from abc import ABCMeta, abstractproperty
Severity: Minor
Found in pytim/surface.py - About 2 hrs to fix

Function __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Function __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Function centerbox has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def centerbox(universe,
              x=None,
              y=None,
              z=None,
              vector=None,
Severity: Minor
Found in pytim/utilities.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 _check_missing_attribute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def _check_missing_attribute(interface, name, classname, group, value):
    """ Add an attribute, which is necessary for pytim but
        missing from the present topology.

        An example of how the code below would expand is:
Severity: Minor
Found in pytim/properties.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 _writepdb has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def _writepdb(interface,
              filename='layers.pdb',
              centered='no',
              group='all',
              multiframe=True,
Severity: Minor
Found in pytim/writepdb.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 sample has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def sample(self, group, **kargs):
        # TODO: implement progressive averaging to handle very long trajs
        # TODO: implement memory cleanup
        if not isinstance(group, AtomGroup):
            raise TypeError("The first argument passed to "
Severity: Minor
Found in pytim/observables/profile.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 _vdwradii_gmx has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _vdwradii_gmx(self, filename):
        with open(filename) as f:
            input_type = 'sigeps'
            content = f.read()
            if re.match('.*name.*c6 *c12.*', content.replace('\n', ' ')):
Severity: Minor
Found in pytim/datafiles/__init__.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 sample has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def sample(self):
        """ samples the profile of a droplet, stores
            the current atomic coordinates of the liquid surface
            not in contact with the substrate in the reference
            frame of the droplet, and optionally the coordinates
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 __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

    def __init__(self,
                 universe,
                 group=None,
                 alpha=1.5,
                 symmetry='generic',
Severity: Minor
Found in pytim/simple_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 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, inter, substrate, periodic=None, hcut=0.0, hcut_upper=None,
Severity: Major
Found in pytim/observables/contactangle.py - About 1 hr to fix

Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

    def assign_radii(self, radii_dict=None):

        if radii_dict is not None:
            self.interface.radii_dict = radii_dict.copy()
        else:
Severity: Minor
Found in pytim/sanity_check.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 _fit_ellipse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def _fit_ellipse(x, y, nonlinear=True, off=0.0, points_density=25, verbose=False):
        """  fit an ellipse through the points (x,y)

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

Severity
Category
Status
Source
Language