hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function _explain_to has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def _explain_to(self, message):
        """Copy MH-specific state to message insofar as possible."""
        if isinstance(message, MaildirMessage):
            sequences = set(self.get_sequences())
            if 'unseen' in sequences:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/mailbox.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 _parse_doctype_entity has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse_doctype_entity(self, i, declstartpos):
        rawdata = self.rawdata
        if rawdata[i:i+1] == "%":
            j = i + 1
            while 1:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/markupbase.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 renameNode has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def renameNode(self, n, namespaceURI, name):
        if n.ownerDocument is not self:
            raise xml.dom.WrongDocumentErr(
                "cannot rename nodes from other documents;\n"
                "expected %s,\nfound %s" % (self, n.ownerDocument))
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/xml/dom/minidom.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 open_ftp has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def open_ftp(self, url):
        """Use FTP protocol."""
        if not isinstance(url, str):
            raise IOError, ('ftp error', 'proxy support for ftp protocol currently not implemented')
        import mimetypes, mimetools
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/urllib.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 lock has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def lock(self, how, *args):
        import struct, fcntl

        if 'w' in how: l_type = fcntl.F_WRLCK
        elif 'r' in how: l_type = fcntl.F_RDLCK
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/posixfile.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 urlencode has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def urlencode(query, doseq=0):
    """Encode a sequence of two-element tuples or dictionary into a URL query string.

    If any values in the query arg are sequences and doseq is true, each
    sequence element is converted to a separate parameter.
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/urllib.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 generate_matches has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_matches(self, nodes):
        """
        Generator yielding matches for a sequence of nodes.

        Args:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pytree.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 parse_tokens has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_tokens(self, tokens, debug=False):
        """Parse a series of tokens and return the syntax tree."""
        # XXX Move the prefix computation into a wrapper around tokenize.
        p = parse.Parser(self.grammar, self.convert)
        p.setup()
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/driver.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 transform has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def transform(self, node, results):
        syms = self.syms

        tail = [n.clone() for n in results["tail"]]
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/fixes/fix_except.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 _make_spec_file has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def _make_spec_file(self):
        """Generate the text of an RPM spec file and return it as a
        list of strings (one per line).
        """
        # definitions and headers

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 has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def find(domain, localedir=None, languages=None, all=0):
    # Get some reasonable defaults for arguments that were not supplied
    if localedir is None:
        localedir = _default_localedir
    if languages is None:
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/gettext.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 walk_packages has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

def walk_packages(path=None, prefix='', onerror=None):
    """Yields (module_loader, name, ispkg) for all modules recursively
    on path, or, if path is None, all accessible modules.

    'path' should be either None or a list of paths to look for
Severity: Minor
Found in vector-uefi/fd/efi/StdLib/lib/python.27/pkgutil.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

File aliases.py has 321 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Encoding Aliases Support

    This module is used by the encodings package search function to
    map encodings names to module names.
Severity: Minor
Found in AppPkg/Applications/Python/Python-2.7.2/Lib/encodings/aliases.py - About 3 hrs to fix

    File aliases.py has 321 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """ Encoding Aliases Support
    
        This module is used by the encodings package search function to
        map encodings names to module names.
    
    Severity: Minor
    Found in vector-uefi/fd/efi/StdLib/lib/python.27/encodings/aliases.py - About 3 hrs to fix

      File LzBinTree.cs has 321 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System;
      
      namespace SevenZip.Compression.LZ
      {
          public class BinTree : InWindow, IMatchFinder
      Severity: Minor
      Found in vector-uefi/insyde/7zip/CS/7zip/Compress/LZ/LzBinTree.cs - About 3 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                            if LA4 == 66:
                                alt4 = 1
                            elif LA4 == 58:
                                LA4_21 = self.input.LA(3)
        
        Severity: Critical
        Found in BaseTools/Source/Python/Ecc/CParser.py - About 3 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                                  if LA50 == 63:
                                      LA50_12 = self.input.LA(3)
          
                                      if (self.synpred91()) :
                                          alt50 = 1
          Severity: Critical
          Found in BaseTools/Source/Python/Ecc/CParser.py - About 3 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                        if LA33 == 63:
                                            LA33_30 = self.input.LA(3)
            
                                            if (self.synpred70()) :
                                                alt33 = 1
            Severity: Critical
            Found in BaseTools/Source/Python/Ecc/CParser.py - About 3 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                          if LA31 == 63:
                                              LA31_30 = self.input.LA(3)
              
                                              if (self.synpred67()) :
                                                  alt31 = 1
              Severity: Critical
              Found in BaseTools/Source/Python/Ecc/CParser.py - About 3 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                                        if LA53 == 63:
                                            LA53_12 = self.input.LA(3)
                
                                            if (self.synpred94()) :
                                                alt53 = 1
                Severity: Critical
                Found in BaseTools/Source/Python/Ecc/CParser.py - About 3 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language