savkov/planchet

View on GitHub

Showing 6 of 6 total issues

File app.py has 265 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import json
import logging
import sys
from typing import List, Callable, Dict, Tuple, Union

Severity: Minor
Found in app.py - About 2 hrs to fix

    Function start_job has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def start_job(self, job_name: str, metadata: Dict, reader_name: str,
    Severity: Major
    Found in planchet/client.py - About 1 hr to fix

      Function scramble has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def scramble(job_name: str, metadata: Dict, reader_name: str,
      Severity: Major
      Found in app.py - About 1 hr to fix

        Function serve has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def serve(self, n_items: int) -> List:
                """
                Send `n_items` to the user.
        
                :param n_items: number of items served
        Severity: Minor
        Found in planchet/core.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, name: str, reader: Callable, writer: Callable,
        Severity: Minor
        Found in planchet/core.py - About 45 mins to fix

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

              def send(self, job_name: str, items: List[Tuple[int, Union[Dict, List]]],
          Severity: Minor
          Found in planchet/client.py - About 35 mins to fix
            Severity
            Category
            Status
            Source
            Language