resources/lib/database/db_shared.py
File db_shared.py
has 431 lines of code (exceeds 400 allowed). Consider refactoring. Open
Open
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2019 Stefano Gottardo - @CastagnaIT (original implementation module)
Sharable database access and functions
Function get_shareddb_class
has a Cognitive Complexity of 24 (exceeds 10 allowed). Consider refactoring. Open
Open
def get_shareddb_class(use_mysql=False):
# Dynamically sets the inherit class
base_class = db_base_mysql.MySQLDatabase if use_mysql else db_base_sqlite.SQLiteDatabase
class NFSharedDatabase(base_class):
- 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_stream_continuity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_stream_continuity(self, profile_guid, videoid, default_value=None, data_type=None):
Function get_watched_status
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_watched_status(self, profile_guid, videoid, default_value=None, data_type=None):
Function insert_episode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def insert_episode(self, tvshowid, seasonid, episodeid, file_path):
Function get_tvshow_property
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_tvshow_property(self, tvshowid, enum_vid_prop, default_value=None, data_type=None):