Marcello-Sega/pytim

View on GitHub

Showing 85 of 713 total issues

File contactangle.py has 918 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: Major
Found in pytim/observables/contactangle.py - About 2 days to fix

File interface.py has 572 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 _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

ContactAngle has 40 functions (exceeds 20 allowed). Consider refactoring.
Open

class ContactAngle(object):
    """ ContactAngle class implementation that uses interfacial atoms to compute\
        droplet profiles and contact angles using different approaches.

        :param PYTIM             interface:   Compute the contact angle for this interface
Severity: Minor
Found in pytim/observables/contactangle.py - About 5 hrs to fix

Function _select_coords has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def _select_coords(self, use, bins):
        # return lists of array with coordinates falling into the bins that partition the symmetric coordinate.
        # The main idea is to use the instantaneous or stored cartesian coordinates (renamed so that z is always
        # the surface normal and, in case of cylyndrical symmetry, y points along the cylinder axis.
        # The cae of the histogram is different, because the relation, say (x,z) is not necessarily a function.
Severity: Minor
Found in pytim/observables/contactangle.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 itim.py has 318 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

File gitim.py has 289 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

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

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

    def __init__(self,
Severity: Major
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

Function _assign_one_side has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def _assign_one_side(self,
                         uplow,
                         sorted_atoms,
                         _x,
                         _y,
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 __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 _ellipse_general_to_canonical has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def _ellipse_general_to_canonical(coeffs, check_coeffs=True):
        """ Convert general coefficients (a,b,c,d,e,f) to canonical ones.

            :param list coeffs       : general coefficients
            :param bool check_coeffs : raise an error if the coefficients do not represent
Severity: Minor
Found in pytim/observables/contactangle.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 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

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

Interface has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class Interface(object):
    """ The Interface metaclass. Classes for interfacial determination
        (ITIM, GITIM,...) are derived from this one
    """
    __metaclass__ = ABCMeta
Severity: Minor
Found in pytim/interface.py - About 2 hrs to fix
Severity
Category
Status
Source
Language