plugins/pymol/plugin.py

Summary

Maintainability
B
6 hrs
Test Coverage

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

          Error: Missing parentheses in call to 'print'. Did you mean print(print "color", name, c, ck # noqa: E999)? (<unknown>, line 40)</unknown>
          Open

          Severity: Minor
          Found in plugins/pymol/plugin.py by radon

          We encountered an error attempting to analyze this line.

          There are no issues that match your filters.

          Category
          Status