thatsIch/sublime-rainmeter

View on GitHub

Showing 68 of 68 total issues

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

def find_skin_name_in_inis(inis):
    """
    Retrieve skin name in a configuration.

    A configuration can contain multiple skins.
Severity: Minor
Found in install/from_folder.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

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

def levenshtein(top_string, bot_string):
    """
    The Levenshtein distance is a string metric for measuring the difference between two sequences.

    Informally,
Severity: Minor
Found in completion/levenshtein.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

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

def find_resources_folder_in_folder(folder):
    """
    Find a single @Resources folder in the given folder.
    """
    for root, directories, dummy_files in os.walk(folder):
Severity: Minor
Found in install/from_folder.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

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

def get_cached_setting_path():
    """Get the value of the #SETTINGSPATH# variable."""
    rainmeterpath = get_cached_program_path()

    if not rainmeterpath:
Severity: Minor
Found in path/setting_path_provider.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

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

    def run(self):
        """Automatically executed upon calling this command."""
        # check cache first to determine the default path shown to the user
        install_cache_path = os.path.join(sublime.cache_path(), "Rainmeter", "install", "last_entered_folder.cache")
        if os.path.exists(install_cache_path) and os.path.isfile(install_cache_path):
Severity: Minor
Found in install_skin.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

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

def find_inis_in_folder(folder):
    """
    Retrieve path of every file ending with .ini in folder.

    Returns the absolute path of each found file.
Severity: Minor
Found in install/from_folder.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

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

def __handle_program_path_init():
    program_path = get_cached_program_path()
    if not program_path:
        # Open dialog and set program path.
        # Due to cache this might be annoying
Severity: Minor
Found in path_initializer.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

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

def __handle_skin_path_init():
    skin_path = get_cached_skin_path()
    if not skin_path:
        # Open folder dialog and set skin path.

Severity: Minor
Found in path_initializer.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