Showing 17 of 35 total issues
File dotexporter.py
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
import codecs
import itertools
import logging
import re
from os import path, remove
File render.py
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
"""
Tree Rendering.
* :any:`RenderTree` using the following styles:
File resolver.py
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
from __future__ import print_function
Function get
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get(self, node, path):
"""
Return instance at `path`.
An example module tree:
- Read upRead up
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 __start
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __start(self, node, path, cmp_):
sep = node.separator
parts = path.split(sep)
# resolve root
if path.startswith(sep):
- Read upRead up
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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _iter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _iter(children, filter_, stop, maxlevel):
if children:
if ASSERTIONS: # pragma: no branch
assert len(children) == 1
_iter = LevelOrderGroupIter(children[0], filter_, stop, maxlevel)
- Read upRead up
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 by_attr
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def by_attr(self, attrname="name"):
"""
Return rendered tree with node attribute `attrname`.
>>> from anytree import AnyNode, RenderTree
- Read upRead up
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 findall
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def findall(node, filter_=None, stop=None, maxlevel=None, mincount=None, maxcount=None):
Function findall
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def findall(node, filter_=None, stop=None, maxlevel=None, mincount=None, maxcount=None):
Function findall_by_attr
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def findall_by_attr(node, value, name="name", maxlevel=None, mincount=None, maxcount=None):
Function findall_by_attr
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def findall_by_attr(node, value, name="name", maxlevel=None, mincount=None, maxcount=None):
Function _findall
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _findall(node, filter_, stop=None, maxlevel=None, mincount=None, maxcount=None):
Function __iter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __iter(self, indent, nodenamefunc, nodeattrfunc, edgeattrfunc, edgetypefunc):
Avoid too many return
statements within this function. Open
return matches
Avoid too many return
statements within this function. Open
return matches
Function walk
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def walk(start, end):
"""
Walk from `start` node to `end` node.
Returns:
- Read upRead up
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"