Showing 6 of 6 total issues
File app.py
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import logging
import sys
from typing import List, Callable, Dict, Tuple, Union
Function start_job
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def start_job(self, job_name: str, metadata: Dict, reader_name: str,
Function scramble
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def scramble(job_name: str, metadata: Dict, reader_name: str,
Function serve
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def serve(self, n_items: int) -> List:
"""
Send `n_items` to the user.
:param n_items: number of items served
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, name: str, reader: Callable, writer: Callable,
Function send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def send(self, job_name: str, items: List[Tuple[int, Union[Dict, List]]],