almlab/angst

View on GitHub

Showing 70 of 94 total issues

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

    def TreeLink(self,other_tree):
        ''' code to link the nodes of two trees whose newick ordering
        of nodes may be different, but whose overall topology is
        identical. '''

Severity: Minor
Found in tree_lib/multitree.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 GetHeights has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def GetHeights(self):
        ''' get MEDIAN distance to leaves at all internal nodes on the
        tree '''

        # get distances from leaves
Severity: Minor
Found in tree_lib/node.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 MergeNodeLinkDicts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def MergeNodeLinkDicts(self,other_dict):
        '''merge lists of linked nodes'''

        for leaves in other_dict:
            if leaves in self.link_dict:
Severity: Minor
Found in angst_lib/reconcile.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 Find_Subnodes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def Find_Subnodes(self):

        for kid_nodes in self.kid_nodes.keys():
            new_dict = kid_nodes.Find_Subnodes()
            for k in new_dict.keys():
Severity: Minor
Found in tree_lib/node.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 ValidTransfer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def ValidTransfer(self,other_node):
        ''' return boolean regarding whether or not the parent
        branches of the queried nodes overlap temporally '''

        # no auto-transfer
Severity: Minor
Found in tree_lib/node.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 findBranches has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def findBranches(self,all_branches):

    all_branches.append(self)
    self.visited = True

Severity: Minor
Found in tree_lib/branch.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 FindDists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def FindDists(self):
        ''' recursively enumerate all pairwise distances on the
        species tree '''

        dist_dict = self.tree.dist_dict
Severity: Minor
Found in tree_lib/node.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 FindLCA has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def FindLCA(self,node1,node2):
        ''' find the last common ancestor of two nodes.  will descend
        from the subroot (self) looking to see which children possess
        both nodes.  if neither children possess both nodes, return
        current node '''
Severity: Minor
Found in tree_lib/node.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 GetOtherNodes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def GetOtherNodes(this_node):

        # fill out the leaf dictionary
        other_nodes = []
        for branch in this_node.branch_list:
Severity: Minor
Found in tree_lib/node.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 PrintAllEvents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def PrintAllEvents(this_node,lca,output_file):
  event_counts = {'hgt':0, 'dup':0, 'los':0, 'spc':0}
  events = this_node.raw_list
  for event in events:
    output_file.write(event + "\n")
Severity: Minor
Found in angst_lib/output.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