build/lib/compress_json/compress_json.py
File compress_json.py
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# -*- coding: utf-8 -*-
"""
A thin wrapper of standard ``json`` with standard compression libraries.
"""
import json
Function load
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def load(
path: str,
compression_kwargs: Optional[Dict] = None,
json_kwargs: Optional[Dict] = None,
encoding: str = "utf-8",
- 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 dump
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def dump(
obj: Any,
path: str,
compression_kwargs: Optional[Dict] = None,
json_kwargs: Optional[Dict] = None,
- 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 local_dump
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def local_dump(
Function load
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def load(
Function local_load
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def local_load(
Function dump
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def dump(