ergonomica/ergonomica

View on GitHub

Showing 154 of 154 total issues

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

def net(argc):
    """net: Various network information commands.
    Usage:
        net ip (local|global)
        net mac INTERFACE
Severity: Minor
Found in ergonomica/lib/lib/ergo_net.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 symlink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def symlink(source, link_name):
    import os
    os_symlink = getattr(os, "symlink", None)
    if callable(os_symlink):
        os_symlink(source, link_name)
Severity: Minor
Found in ergonomica/lib/lib/ergo_link.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 file_lines has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def file_lines(stdin):
    split_lines = [""]
    paren_depth = 0
    for line in stdin.split("\n"):
        line = line.strip()
Severity: Minor
Found in ergonomica/lib/lang/parser.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 _range has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _range(argc):
    """range: Construct a range of integers.

    Usage:
        range END
Severity: Minor
Found in ergonomica/lib/lib/ergo_range.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 ergo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def ergo(stdin, namespace=namespace):
    if stdin.strip() == "":
        return None
    try:
        return eval(parse(tokenize(stdin)), namespace, True)
Severity: Minor
Found in ergonomica/lib/lang/interpreter.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 arglist has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def arglist(_function):
    if isinstance(_function, function):
        return _function.args
    # they don't have args attributes since they're not actual Python functions
    if isinstance(_function, types.BuiltinFunctionType):
Severity: Minor
Found in ergonomica/lib/lang/interpreter.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 flatten has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def flatten(arr):
    
    if not isinstance(arr, list):
        raise ErgonomicaError("[ergo: flatten]: Non-list passed.")
    
Severity: Minor
Found in ergonomica/lib/lang/builtins.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

TODO found
Open

        # TODO: have this give the actual offending number
Severity: Minor
Found in ergonomica/lib/lib/ergo_range.py by fixme

TODO found
Open

                # TODO: instead of checking for a FileNotFoundError, check if the command is in the user's PATH.
Severity: Minor
Found in ergonomica/lib/lang/interpreter.py by fixme

XXX found
Open

notes=FIXME,XXX,TODO
Severity: Minor
Found in pylintrc by fixme

TODO found
Open

notes=FIXME,XXX,TODO
Severity: Minor
Found in pylintrc by fixme

TODO found
Open

        # TODO: clean this up. potentially take inspiration from Fish shell?
Severity: Minor
Found in ergonomica/lib/interface/completer.py by fixme

TODO found
Open

    # TODO: complete this
Severity: Minor
Found in tests/stdlib/test_list_modules.py by fixme

FIXME found
Open

notes=FIXME,XXX,TODO
Severity: Minor
Found in pylintrc by fixme
Severity
Category
Status
Source
Language