Marcello-Sega/pytim

View on GitHub

Showing 83 of 571 total issues

File interface.py has 561 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 abc import ABCMeta, abstractmethod
import numpy as np
from .properties import _create_property
Severity: Major
Found in pytim/interface.py - About 1 day to fix

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

    def sample(self, bins=100, params=None, binning='theta', periodic=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)

        """
Severity: Minor
Found in pytim/observables/contactangle.py - About 6 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 _set_default_values has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    def _set_default_values(self, generalized_coordinate, max_distance, nbins):

        self.dimensions = np.asarray(self.coords_in).shape[0]
        self.dimensions_out = np.asarray(self.coords_out).shape[0]
        self.generalized_coordinate = generalized_coordinate
Severity: Minor
Found in pytim/observables/distributionfunction.py - About 5 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 contactangle.py has 402 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
""" Module: ContactAngle
    ====================
"""
Severity: Minor
Found in pytim/observables/contactangle.py - About 5 hrs to fix

File itim.py has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
""" Module: itim
    ============
Severity: Minor
Found in pytim/itim.py - About 3 hrs to fix

File correlator.py has 302 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
""" Module: Correlator
    ==================
"""
Severity: Minor
Found in pytim/observables/correlator.py - About 3 hrs to fix

File profile.py has 299 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
""" Module: Profile
    ===============
"""
Severity: Minor
Found in pytim/observables/profile.py - About 3 hrs to fix

Function _assign_layers has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def _assign_layers(self):
        """ Determine the ITIM layers.

            Note that the multiproc option is mainly for debugging purposes:
            >>> import MDAnalysis as mda
Severity: Minor
Found in pytim/itim.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 gitim.py has 272 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
""" Module: gitim
    =============
Severity: Minor
Found in pytim/gitim.py - About 2 hrs to fix

File rdf.py has 269 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
""" Module: RDF
    ===========
"""
Severity: Minor
Found in pytim/observables/rdf.py - About 2 hrs to fix

File basic_observables.py has 268 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
""" Module: basic_observables
    =========================
"""
Severity: Minor
Found in pytim/observables/basic_observables.py - About 2 hrs to fix

File __init__.py has 262 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
""" Location of data files for Pytim examples and tests
====================================================

Severity: Minor
Found in pytim/datafiles/__init__.py - About 2 hrs to fix

Function compute_sasa has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_sasa(self, group):
        box = group.universe.dimensions[:3]
        self.Rmax = np.max(group.radii)
        self.tree = cKDTree(group.positions, boxsize=box)
        self.sasa_group = group
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 sample has a Cognitive Complexity of 17 (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/distributionfunction.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 __init__ has 18 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

File distributionfunction.py has 257 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
""" Module: DistributionFunction
    ============================
"""
Severity: Minor
Found in pytim/observables/distributionfunction.py - About 2 hrs to fix

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

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

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
Severity
Category
Status
Source
Language