Showing 6 of 6 total issues
File _main.py
has 1348 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# pylint: disable=too-many-lines
"""Pandoc filter to number all kinds of things."""
Numbered
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Numbered:
"""
Numbered elements.
"""
Function _compute_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _compute_data(self):
# pylint: disable=too-many-statements,no-member
classes = self._doc.defined[self._basic_category]["classes"]
if self._alias == self._tag:
self._set_content(
Function _compute_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _compute_data(self):
# pylint: disable=too-many-statements,no-member
classes = self._doc.defined[self._basic_category]["classes"]
if self._alias == self._tag:
self._set_content(
- 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 _compute_alias
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _compute_alias(self):
# Determine the final alias
if not self._title:
if self._section_alias:
self._alias = (
- 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 _compute_title
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _compute_title(self):
self._title = []
if (
isinstance(self._get_content()[-3], Str)
and self._get_content()[-3].text[-1:] == ")"
- 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"