Showing 168 of 168 total issues
File __init__.py
has 847 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
# Licenseware SDK
This is the licenseware **Python3** sdk useful for quickly create apps.
The SDK handles the repetetive actions needed for creating an app (file uploads/validation, background events, api routes and more).
File mongodata.py
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Abstraction and validation of inserted data in mongodb
File app_builder.py
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
`AppBuilder` is reponsible for creating the Api from the `X_namespace` packages and `X_route` modules. Authenticates the `App` and sends the registration information to registry-service.
Notice that history report route/path is provided but is not implemented that's because a report must be defined with aggregated data from AnalysisStats mongo collection.
Function fetch
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def fetch(
match: Union[dict, Tuple[Dict[str, str], Dict[str, int]]],
collection: str,
as_list: bool = True,
limit: int = 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
File file_validators.py
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Validator for streams of files and files.
File editable_table.py
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
EditableTable provided in this package is used to generate table metadata from a marshmallow Schema
File history.py
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
import inspect
import time
import traceback
from copy import deepcopy
from functools import wraps
Function log
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def log(
*dargs,
on_success_save: str = None,
on_failure_save: str = None,
on_failure_return: Any = 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 get_value_from_kwargs
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def get_value_from_kwargs(func_kwargs, *params):
for param in params:
if func_kwargs.get(param) is not None:
return func_kwargs[param]
- 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 parse_schema
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def parse_schema(self, tag):
# print("parse_schema", tag)
payload = {}
- 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
AppBuilder
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class AppBuilder:
def __init__(
self,
name: str,
description: str,
File uploader_encryptor.py
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import re
import shutil
from typing import Dict, List
Function ma_metadata_to_restx_model
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def ma_metadata_to_restx_model(api: Api, ma_metadata: dict):
restx_model = {}
for schema_name, mameta in ma_metadata.items():
- 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
File report_snapshot.py
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
import random
import string
import uuid
from datetime import datetime
from typing import List
Function __init__
has 22 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
MongoRepository
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class MongoRepository(RepositoryInterface):
def __init__(
self,
db_connection: Database,
collection: str = None,
Function recursive_unzip
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def recursive_unzip(file_path: str):
"""
Iterate over an archive and recursively extract all archives using unzip function
"""
- 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
File uploader_builder.py
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import Callable, Dict, List
from flask import Request
from licenseware import history
Function __init__
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function extract_headers
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def extract_headers(req_data):
# TODO extract security headers
headers = {}
if req_data.get("parameters"):
- 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"