Showing 71 of 71 total issues
File model.py
has 610 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Overview:
Color model, include rgb, hsv, hls color system.
More color system will be supported soon.
Function isolated_entry_points
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
def isolated_entry_points(group: str, fakes: Union[List, Dict[str, Any], None] = None,
auto_import: bool = True, clear: bool = False):
"""
Overview:
Isolation for :func:`pkg_resources.iter_entry_points` function.
- 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 cases
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def cases(self) -> Iterator[Mapping[str, object]]:
"""
Get the cases in this AETG model.
Examples::
- 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
File inflection.py
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Overview:
Useful utilities for word inflections.
Extended based on `jpvanhal/inflection <https://github.com/jpvanhal/inflection>`_.
File func.py
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Overview:
Useful functions for processing python functions.
"""
import warnings
File clazz.py
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Overview:
Useful functions for build class models.
"""
import os
Function iter_import_objects
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def iter_import_objects(full_pattern: str, predicate: Optional[Callable] = None) \
-> Iterator[Tuple[Any, str, str]]:
"""
Overview:
Quickly dynamically import all objects with full name pattern.
- 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 visual
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def visual(items: Optional[Iterable] = None, show_id: bool = False):
"""
Overview:
Decorate class to be visible by `repr`.
- 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 _eq_compare_message
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _eq_compare_message(expect: List[str], actual: List[str], max_diff: int = 3, max_extra: int = 5):
if expect == actual: # pragma: no cover
return 'No difference found.'
else:
with io.StringIO() as sf:
- 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 _rmtree
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _rmtree(cls, name, ignore_errors=False):
def onerror(func, path, exc_info):
if issubclass(exc_info[0], PermissionError):
def resetperms(path):
try:
- 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
File context.py
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Overview:
Utilities for building context variables on thread level.
This is useful when implementing a with-block-based syntax.
Function tmatrix
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def tmatrix(ranges: Mapping[Union[str, Tuple[str, ...]], List],
mode='aetg', seed: Optional[int] = 0, level: int = 2) -> Tuple[List[str], List[Tuple]]:
"""
Overview:
Test matrix generator, which can be used in ``pytest.mark.parameterize``.
- 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 freduce
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def freduce(init=NO_INITIAL, pass_kwargs: bool = True):
"""
Overview:
Make binary function be reducible.
- 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 _yield_from_units
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _yield_from_units(fes, auto_import: bool = True) -> Iterator[Tuple[str, Any]]:
if isinstance(fes, (list, tuple)):
for item in fes:
if isinstance(item, tuple) and len(item) == 2:
name, dist = item
- 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 cases
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def cases(self) -> Iterator[Mapping[str, Any]]:
"""
Get the cases in this matrix.
Examples::
- 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 _yield_reqs_to_install
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _yield_reqs_to_install(req: Requirement, current_extra: str = ''):
if req.marker and not req.marker.evaluate({'extra': current_extra}):
return
try:
- 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 accessor
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def accessor(items: Optional[Iterable] = None, readonly: bool = False):
"""
Overview:
Decorate class to be accessible by the accessors.
- 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
Color
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Color:
"""
Overview:
Color utility object.
Function get_repr_info
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def get_repr_info(cls: type, args: List[Tuple]) -> str:
"""
Overview:
Get representation information for object.
Can be used in ``__repr__`` method for class.
- 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
File text.py
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import io
import os
import textwrap
from typing import List, Union