tadashi-aikawa/owlmixin

View on GitHub
owlmixin/owlcollections.py

Summary

Maintainability
F
3 days
Test Coverage

File owlcollections.py has 841 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding: utf-8

import functools
from collections import deque
from itertools import chain, filterfalse, groupby, islice, takewhile, tee
Severity: Major
Found in owlmixin/owlcollections.py - About 2 days to fix

    TIterator has 35 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class TIterator(
        DictsTransformer,
        JsonTransformer,
        YamlTransformer,
        CsvTransformer,
    Severity: Minor
    Found in owlmixin/owlcollections.py - About 4 hrs to fix

      TList has 34 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class TList(
          list,
          DictsTransformer,
          JsonTransformer,
          YamlTransformer,
      Severity: Minor
      Found in owlmixin/owlcollections.py - About 4 hrs to fix

        Function uniq_by has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            def uniq_by(self, func: Callable[[T], Any] = None) -> "TIterator[T]":
                """
                Usage:
        
                    >>> it = TIterator([1, 2, 3, -2, -1]).uniq_by(lambda x: x**2)
        Severity: Minor
        Found in owlmixin/owlcollections.py - About 1 hr 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

        There are no issues that match your filters.

        Category
        Status