Seraphim-Solutions/bettercinema

View on GitHub

Showing 9 of 11 total issues

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

# from textwrap import wrap
import os
import hashlib
import json
import sys
Severity: Major
Found in app.py - About 1 day to fix

    Cli has 37 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Cli():
        """handles the cli"""
        def __init__(self):
            ConfigHandler()
            with open('config/config.json', 'r', encoding="utf-8") as f:
    Severity: Minor
    Found in app.py - About 4 hrs to fix

      Function menu has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def menu(self):
              """Shows the main menu"""
              self.clear_table_data()
              self.clear_console()
              vip_data = self.bc.get_vip_status(self.wst)
      Severity: Minor
      Found in app.py - About 3 hrs 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 select_item_from_results has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def select_item_from_results(self):
              """Selects an item from the results"""
               
              selected_movie = inquirer.text(message="~> ").execute()
              commands = ("help", "more", "search", "sort", "menu", "exit")
      Severity: Minor
      Found in app.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 get_ctx1 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_ctx1(self):
              for i in range(1000):
                  ctx1 = ''.encode('utf-8')
                  if i & 1:
                      ctx1 = ctx1 + self.pw
      Severity: Minor
      Found in misc/md5Crypt.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 download_latest_version has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def download_latest_version(self):
              """Download BetterCinema latest version"""
              os_name = platform.system()
              if os_name == "Windows":
                  extension = "exe"
      Severity: Minor
      Found in handlers/version_handler.py - About 55 mins 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 accounts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def accounts(self):
              self.update_user_dict()
              user_choice = inquirer.select(message="Choose account: ", choices=[
                  *self.user_dict,
                  "Add new account",
      Severity: Minor
      Found in app.py - About 45 mins 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 add_trakt_user_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def add_trakt_user_data(self, username, private, vip, vip_ep, slug):
      Severity: Minor
      Found in handlers/db_handler.py - About 35 mins to fix

        Function list_results has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def list_results(self, query, sort):
                """Generates table with results"""
                self.get_result_data()
                
                self.movie_table = Table(show_header=True, header_style=self.color_neutral, title=f'Search Results for \"{query}\" | sort by: {"relevance" if sort == "" else sort}', title_justify="center")
        Severity: Minor
        Found in app.py - About 25 mins 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

        Severity
        Category
        Status
        Source
        Language