Showing 527 of 527 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    def _get_data_arguments(self):
        ret = []
        for a in self.attributes:
            ret.append(a.get_data_arguments())
        return ",\n".join(ret)
Severity: Major
Found in tools/build/_decorators.py and 3 other locations - About 1 hr to fix
tools/build/_decorators.py on lines 456..460
tools/build/_decorators.py on lines 474..478
tools/build/_decorators.py on lines 524..528

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 41.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    def _get_data_members(self):
        ret = []
        for a in self.attributes:
            ret.append(a.get_data_members())
        return "\n".join(ret)
Severity: Major
Found in tools/build/_decorators.py and 3 other locations - About 1 hr to fix
tools/build/_decorators.py on lines 474..478
tools/build/_decorators.py on lines 480..484
tools/build/_decorators.py on lines 524..528

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 41.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    def _get_helpers(self):
        ret = []
        for a in self.attributes:
            ret.append(a.get_helpers())
        return "\n".join(ret)
Severity: Major
Found in tools/build/_decorators.py and 3 other locations - About 1 hr to fix
tools/build/_decorators.py on lines 456..460
tools/build/_decorators.py on lines 480..484
tools/build/_decorators.py on lines 524..528

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 41.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

    def _get_data_initialize(self):
        ret = []
        for a in self.attributes:
            ret.append(a.get_data_initialize())
        return ", ".join(ret)
Severity: Major
Found in tools/build/_decorators.py and 3 other locations - About 1 hr to fix
tools/build/_decorators.py on lines 456..460
tools/build/_decorators.py on lines 474..478
tools/build/_decorators.py on lines 480..484

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 41.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                      coords[:bp[0]] + coords[bp[0] + 1:],
Severity: Minor
Found in examples/motion.py and 1 other location - About 55 mins to fix
examples/motion.py on lines 88..88

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                      radii[:bp[0]] + radii[bp[0] + 1:]):
Severity: Minor
Found in examples/motion.py and 1 other location - About 55 mins to fix
examples/motion.py on lines 87..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 37.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              elif particle_factory.get_is(node):
                  particle = particle_factory.get(node)
                  print("particle", node.get_name(), print_coordinates(reference_frame, particle.get_coordinates()))
          Severity: Minor
          Found in examples/reference_frames.py and 1 other location - About 40 mins to fix
          examples/reference_frames.py on lines 33..35

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 34.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              elif ball_factory.get_is(node):
                  particle = ball_factory.get(node)
                  print("ball", node.get_name(), print_coordinates(reference_frame, particle.get_coordinates()))
          Severity: Minor
          Found in examples/reference_frames.py and 1 other location - About 40 mins to fix
          examples/reference_frames.py on lines 30..32

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 34.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    return ret[0] + ret[1] + ret[2]
                Severity: Minor
                Found in benchmark/benchmark_rmf.py and 1 other location - About 35 mins to fix
                benchmark/benchmark_rmf.py on lines 92..92

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 33.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                Severity
                Category
                Status
                Source
                Language