Showing 19 of 523 total issues

File _decorators.py has 521 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python

import os.path
import sys
import subprocess
Severity: Major
Found in tools/build/_decorators.py - About 1 day to fix

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

    def copy_to_residues(pin, pout, rcf, rf, pcf, pf, acf, af, ccf, cf, bf, prev):
        if rcf.get_is(pin):
            rpin = rcf.get(pin)
            rpout = rf.get(pout)
            rpout.set_residue_type(rpin.get_residue_type())
    Severity: Minor
    Found in examples/add_bonds.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 mkdir has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def mkdir(path, clean=True):
        if os.path.isdir(path):
            if clean:
                # remove any old links
                for f in glob.glob(os.path.join(path, "*")):
    Severity: Minor
    Found in tools/build/make-embed.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 _create_atoms has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def _create_atoms(helper, mydata, model, cgol, created):
        child = False
        for ch in helper.get_children():
            if _create_atoms(ch, mydata, model, cgol, created):
                child = True
    Severity: Minor
    Found in plugins/pymol/plugin.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 copy_to_residues has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def copy_to_residues(pin, pout, rcf, rf, pcf, pf, acf, af, ccf, cf, bf, prev):
    Severity: Major
    Found in examples/add_bonds.py - About 1 hr to fix

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

      def _do_it(path):
          fh = RMF.open_rmf_file_read_only(path)
          mf = RMF.Molecule(fh)
          cf = RMF.ChainFactory(fh)
      
      
      Severity: Minor
      Found in plugins/pymol/plugin.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 visit has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def visit(node, reference_frame, reference_frame_factory, particle_factory,
      Severity: Minor
      Found in examples/reference_frames.py - About 45 mins to fix

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

            def __init__(self, allowed_types, category, name,
        Severity: Minor
        Found in tools/build/_decorators.py - About 45 mins to fix

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

          def _handle_atom_coords(helper, mydata, model, cgol, pd, at):
          Severity: Minor
          Found in plugins/pymol/plugin.py - About 45 mins to fix

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

            def _create_molecules(n, mf, cf, mydata, resolution, created):
                if mf.get_is(n) or cf.get_is(n):
                    _create_molecule(n, mydata, resolution, created)
                elif n.get_type() == RMF.BOND and mydata.bond_factory.get_is(n):
                    _handle_bond(n, created, mydata)
            Severity: Minor
            Found in plugins/pymol/plugin.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 visit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def visit(node, reference_frame, reference_frame_factory, particle_factory,
                      segment_factory, ball_factory):
                if reference_frame_factory.get_is(node):
                    reference_frame = RMF.CoordinateTransformer(
                        reference_frame, reference_frame_factory.get(node))
            Severity: Minor
            Found in examples/reference_frames.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 _create_molecules has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def _create_molecules(n, mf, cf, mydata, resolution, created):
            Severity: Minor
            Found in plugins/pymol/plugin.py - About 45 mins to fix

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

                  def __init__(self, name, data_type, return_type, begin, end):
              Severity: Minor
              Found in tools/build/_decorators.py - About 35 mins to fix

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

                def _create_atoms(helper, mydata, model, cgol, created):
                Severity: Minor
                Found in plugins/pymol/plugin.py - About 35 mins to fix

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

                  def _handle_atom_element(helper, mydata, model, cgol, at):
                  Severity: Minor
                  Found in plugins/pymol/plugin.py - About 35 mins to fix

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

                    def show_data_xml(nh, kc):
                        rh = nh.get_file()
                        # get all the keys, we could pull this up in the call stack
                        keys = rh.get_keys(kc)
                        opened = False
                    Severity: Minor
                    Found in examples/rmf_xml.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 create_hierarchy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def create_hierarchy(radius):
                        root = f.add_node(str(radius), RMF.REPRESENTATION)
                        for i in frange(0., 8, radius):
                            for j in frange(0., 8, radius):
                                for k in frange(0., 8, radius):
                    Severity: Minor
                    Found in examples/alternatives.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 clean_gcdas has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def clean_gcdas():
                        for dirpath, dirnames, filenames in os.walk('.'):
                            for f in filenames:
                                if f.endswith('.gcda'):
                                    os.unlink(os.path.join(dirpath, f))
                    Severity: Minor
                    Found in tools/coverage/setup.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __init__(self, name, attribute_type, function_name=None,
                                     default=None):
                            if attribute_type in ('String', 'Strings'):
                                self._check_string_name(name)
                            if not function_name:
                    Severity: Minor
                    Found in tools/build/_decorators.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