Showing 7 of 7 total issues
File parser.py
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import argparse
import textwrap
from collections import defaultdict
from copy import deepcopy
from traceback import print_exc
Function analyze
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
Open
def analyze(self, docstring: str):
"""Analyze docstring and collect arguments with descriptions.
All arguments have to start with a lowercase letter, be followed
with a colon (:) and then with the description of the argument.
- 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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__(self, constructor, docstring_type='google', **kwargs):
"""Initializes parser analyzing provided class constructor.
Arguments:
constructor:
- 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
Avoid deeply nested control flow statements. Open
Open
if value:
help_strings[argument].append(value)
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, argument_definition, argument_sections, inline=False, indent_sensitive=False, skip=None):
Function __call__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __call__(self, parser, namespace, *args, **kwargs):