bitranox/lib_list

View on GitHub

Showing 6 of 6 total issues

File lib_list.py has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# STDLIB
import fnmatch
import sys
from typing import Any, List, Optional, Tuple, Union

Severity: Minor
Found in lib_list/lib_list.py - About 4 hrs to fix

    Function filter_contains has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def filter_contains(elements: List[Any], search_string: str) -> List[str]:
        """Retrieve a list of string elements that contain the specified search string.
    
        >>> filter_contains([], 'bc')
        []
    Severity: Minor
    Found in lib_list/lib_list.py - About 55 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 is_fnmatching has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def is_fnmatching(elements: List[Any], search_pattern: str) -> bool:
        """True if at least one element is matching the searchpattern
    
        >>> is_fnmatching([], 'bc')
        False
    Severity: Minor
    Found in lib_list/lib_list.py - About 45 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 ls_strip_afz has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def ls_strip_afz(ls_elements: Optional[List[str]]) -> List[str]:
        """
        Entfernt die Anführungszeichen für alle Elemente einer Liste mit Strings.
    
        >>> ls_strip_afz(['"  a"',"'bbb'",'ccc', "   'ddd'"])
    Severity: Minor
    Found in lib_list/lib_list.py - About 45 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 is_element_containing has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def is_element_containing(elements: List[str], search_string: str) -> bool:
        """delivers true, if one of the strings in the list contains (or is equal) the searchstring
    
        >>> is_element_containing([], '')
        False
    Severity: Minor
    Found in lib_list/lib_list.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 filter_fnmatch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def filter_fnmatch(elements: List[Any], search_pattern: str) -> List[str]:
        """Retrieve a list of string elements which are matching the fnmatch search pattern
    
        >>> filter_fnmatch([], 'a*')
        []
    Severity: Minor
    Found in lib_list/lib_list.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

    Severity
    Category
    Status
    Source
    Language