pwoolvett/petri

View on GitHub

Showing 6 of 6 total issues

Function validate_class has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_class(
        cls,
        pkg_name: str,
        cls_name: str,
        config_obj: Union[Dict[str, Any], type, Type["BaseSettings"]],
Severity: Minor
Found in petri/settings.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

Function configure_logging has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def configure_logging(
Severity: Minor
Found in petri/loggin.py - About 45 mins to fix

    Function _control_logging has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _control_logging(
    Severity: Minor
    Found in petri/loggin.py - About 35 mins to fix

      Function _control_logging has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def _control_logging(
          level: LogLevel,
          dest: LogDest,
          formatter: LogFormatter,
          log_file: Path,
      Severity: Minor
      Found in petri/loggin.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 maybe_patch_tqdm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def maybe_patch_tqdm(logger, dev_mode):
          """Replaces ``tqdm.tqdm`` calls with noops."""
      
          if (not dev_mode) and TQDM_INSTALLED:
      
      
      Severity: Minor
      Found in petri/loggin.py - About 25 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 init_dotenv has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def init_dotenv() -> Optional[str]:
          """Loc n' load dotenv file.
      
          Sets the location for a dotenv file containig envvars loads its
          contents.
      Severity: Minor
      Found in petri/dot_env.py - About 25 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