aureooms/sak

View on GitHub
lib/args.py

Summary

Maintainability
D
2 days
Test Coverage

Function parse has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

def parse(argv, args, kwargs):
    """

            >>> from lib.args import *

Severity: Minor
Found in lib/args.py - About 4 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

File args.py has 335 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import lib.json
import itertools
import lib.error
import inspect

Severity: Minor
Found in lib/args.py - About 4 hrs to fix

    Function splitparts has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    def splitparts(string, argv, i=0, j=None, eos=None, buf="", escapefirst=False):
        """
                Splits a command line argument string into tokens. Tokens are separated
                by whitespace. Whitespace can be included inside tokens by wrapping tokens with
                single or double quotes. Whitespace can also be included by escaping them
    Severity: Minor
    Found in lib/args.py - About 2 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 convert has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def convert(handle=lib.error.throws(Exception), **convertors):
        """
    
                >>> from lib.args import *
    
    
    Severity: Minor
    Found in lib/args.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 inflate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def inflate(args, kwargs):
        """
                Loads more arguments if JSON ARGS or KWARGS source have been specified.
                Since JSON KWARGS could contain more ARGS or KWARGS directives
                the inflate operations loops until no JSON source is specified anymore.
    Severity: Minor
    Found in lib/args.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 splitparts has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def splitparts(string, argv, i=0, j=None, eos=None, buf="", escapefirst=False):
    Severity: Major
    Found in lib/args.py - About 50 mins to fix

      Function validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def validate(handle=lib.error.throws(Exception), **predicates):
          """
      
                  >>> from lib.args import *
      
      
      Severity: Minor
      Found in lib/args.py - About 35 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 accepts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def accepts(handle=lib.error.throws(Exception), **types):
          """
      
                  >>> from lib.args import *
      
      
      Severity: Minor
      Found in lib/args.py - About 35 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 mandatory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def mandatory(handle=lib.error.throws(Exception), **names):
          """
      
                  >>> from lib.args import *
      
      
      Severity: Minor
      Found in lib/args.py - About 35 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

      There are no issues that match your filters.

      Category
      Status