hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function serve has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def serve(port, callback=None, completer=None):
    import BaseHTTPServer, mimetools, select

    # Patch up mimetools.Message so it doesn't break if rfc822 is reloaded.
    class Message(mimetools.Message):
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pydoc.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

Function _test has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def _test():
    # Act like gzip; with -d, act like gunzip.
    # The input file is not deleted, however, nor are any other gzip
    # options or features supported.
    args = sys.argv[1:]
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/gzip.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

Function warn_explicit has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def warn_explicit(message, category, filename, lineno,
                  module=None, registry=None, module_globals=None):
    lineno = int(lineno)
    if module is None:
        module = filename or "<unknown>"
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/warnings.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

Function determine_parent has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def determine_parent(self, globals, level=-1):
        if not globals or not level:
            return None
        pkgname = globals.get('__package__')
        if pkgname is not None:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/ihooks.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

Function makepipeline has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def makepipeline(infile, steps, outfile):
    # Build a list with for each command:
    # [input filename or '', command string, kind, output filename or '']

    list = []
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pipes.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

Function cfg_convert has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def cfg_convert(self, value):
        """Default converter for the cfg:// protocol."""
        rest = value
        m = self.WORD_PATTERN.match(rest)
        if m is None:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/logging/config.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

Function check has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def check(file):
    """check(file_or_dir)

    If file_or_dir is a directory and not a symbolic link, then recursively
    descend the directory tree named by file_or_dir, checking all .py files
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/tabnanny.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

Function text has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def text(einfo, context=5):
    """Return a plain text document describing a given traceback."""
    etype, evalue, etb = einfo
    if type(etype) is types.ClassType:
        etype = etype.__name__
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/cgitb.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

Function _optimize_charset has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def _optimize_charset(charset, fixup):
    # internal: optimize character set
    out = []
    outappend = out.append
    charmap = [0]*256
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/sre_compile.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 fixdiv.py has 335 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#! /usr/bin/env python

"""fixdiv - tool to fix division operators.

To use this tool, first run `python -Qwarnall yourscript.py 2>warnings'.
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/fixdiv.py - About 4 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                        if LA90 == 64:
                            LA90_87 = self.input.LA(3)
    
                            if (self.synpred182()) :
                                alt90 = 1
    Severity: Critical
    Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

      Consider simplifying this complex logical expression.
      Open

                          if LA90 == 64:
                              LA90_135 = self.input.LA(3)
      
                              if (self.synpred182()) :
                                  alt90 = 1
      Severity: Critical
      Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                                if LA95 == IDENTIFIER:
                                    LA95_185 = self.input.LA(3)
        
                                    if (self.synpred188()) :
                                        alt95 = 1
        Severity: Critical
        Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                                  if LA95 == 64:
                                      LA95_161 = self.input.LA(3)
          
                                      if (self.synpred188()) :
                                          alt95 = 1
          Severity: Critical
          Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                if LA90 == 64:
                                    LA90_209 = self.input.LA(3)
            
                                    if (self.synpred182()) :
                                        alt90 = 1
            Severity: Critical
            Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                      if LA95 == 64:
                                          LA95_211 = self.input.LA(3)
              
                                          if (self.synpred188()) :
                                              alt95 = 1
              Severity: Critical
              Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                                    if LA90 == IDENTIFIER:
                                        LA90_183 = self.input.LA(3)
                
                                        if (self.synpred182()) :
                                            alt90 = 1
                Severity: Critical
                Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                                      if LA90 == 64:
                                          LA90_159 = self.input.LA(3)
                  
                                          if (self.synpred182()) :
                                              alt90 = 1
                  Severity: Critical
                  Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                                            if LA95 == 64:
                                                LA95_89 = self.input.LA(3)
                    
                                                if (self.synpred188()) :
                                                    alt95 = 1
                    Severity: Critical
                    Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix

                      Consider simplifying this complex logical expression.
                      Open

                                              if LA95 == 64:
                                                  LA95_113 = self.input.LA(3)
                      
                                                  if (self.synpred188()) :
                                                      alt95 = 1
                      Severity: Critical
                      Found in BaseTools/Source/Python/Ecc/CParser.py - About 4 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language