hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function _PostProcess has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def _PostProcess(self):
        Processer = {
            MODEL_META_DATA_SECTION_HEADER                  :   self.__ProcessSectionHeader,
            MODEL_META_DATA_SUBSECTION_HEADER               :   self.__ProcessSubsectionHeader,
            MODEL_META_DATA_HEADER                          :   self.__ProcessDefine,
Severity: Minor
Found in BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.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 StoreFunctionDefinition has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def StoreFunctionDefinition(self, StartLine, StartOffset, EndLine, EndOffset, ModifierText, DeclText, LeftBraceLine, LeftBraceOffset, DeclLine, DeclOffset):
Severity: Major
Found in BaseTools/Source/Python/Eot/CParser.py - About 1 hr to fix

    Function init_declarator has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def init_declarator(self, ):
    
            init_declarator_StartIndex = self.input.index()
            try:
                try:
    Severity: Minor
    Found in BaseTools/Source/Python/Eot/CParser.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 enumerator has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def enumerator(self, ):
    
            enumerator_StartIndex = self.input.index()
            try:
                try:
    Severity: Minor
    Found in BaseTools/Source/Python/Eot/CParser.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 markup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
            """Mark up some plain text, given a context of symbols to look for.
            Each context dictionary maps object names to anchor names."""
            escape = escape or self.escape
            results = []
    Severity: Minor
    Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.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 main has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def main(argv):
    
      # use 1st argument as name of tool to call
      Command = pipes.quote(sys.argv[1]);
      
    Severity: Minor
    Found in BaseTools/Bin/CYGWIN_NT-5.1-i686/armcc_wrapper.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 process has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def process(filename, listnames):
        if os.path.isdir(filename):
            return processdir(filename, listnames)
        try:
            fp = open(filename)
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/finddiv.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, CName = '', Token = '', TokenSpaceGuidCName = '', DatumType = '', MaxDatumSize = '', DefaultValue = '', ItemType = '', ValidUsage = None, SkuInfoList = None, SupModuleList = None):
    Severity: Major
    Found in BaseTools/Source/Python/CommonDataClass/CommonClass.py - About 1 hr to fix

      Function proxyval has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def proxyval(self, visited):
              # From unicodeobject.h:
              #     Py_ssize_t length;  /* Length of raw Unicode data in buffer */
              #     Py_UNICODE *str;    /* Raw Unicode buffer */
              field_length = long(self.field('length'))
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.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 tokeneater has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def tokeneater(self, type, token, (sline, scol), end, line,
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/reindent.py - About 1 hr to fix

        Function synopsis has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def synopsis(filename, cache={}):
            """Get the one-line summary out of a module file."""
            mtime = os.stat(filename).st_mtime
            lastupdate, result = cache.get(filename, (0, None))
            if lastupdate < mtime:
        Severity: Minor
        Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.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 __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, ID = -1, Name = '', ExtName = '', Path = '', FullPath = '', Model = MODEL_UNKNOWN, TimeStamp = '', \
        Severity: Major
        Found in BaseTools/Source/Python/CommonDataClass/DataClass.py - About 1 hr to fix

          Function ttypager has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def ttypager(text):
              """Page through text on a text terminal."""
              lines = split(plain(text), '\n')
              try:
                  import tty
          Severity: Minor
          Found in AppPkg/Applications/Python/PyMod-2.7.2/Lib/pydoc.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 calibrate_test has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def calibrate_test(self):
          
                  if self.calibration_runs == 0:
                      self.overhead_times = [0.0]
                      return
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/pybench/pybench.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 printcallee has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def printcallee():
              flist = file2undef.keys()
              flist.sort()
              for filename in flist:
                  print filename + ':'
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/scripts/objgraph.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 load_all_symbols has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def load_all_symbols(self, verbose = False):
                  if self.DebugInfos == []:
                      self.get_debug_info()
                  
                  for debug_info in self.DebugInfos:
          Severity: Minor
          Found in ArmPlatformPkg/Scripts/Ds5/firmware_volume.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 fetch_server_certificate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def fetch_server_certificate (host, port):
          
              import re, tempfile, os, ssl
          
              def subproc(cmd):

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

              def readhtml(self, url_pair):
                  url = url_pair[0]
                  text = None
                  path = self.savefilename(url)
                  try:

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

              def write_repr(self, out, visited):
                  out.write(self.safe_tp_name())
          
                  # Guard against infinite loops:
                  if self.as_address() in visited:
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.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 getmakevars has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def getmakevars(filename):
              variables = {}
              fp = open(filename)
              pendingline = ""
              try:
          Severity: Minor
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/freeze/parsesetup.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

          Severity
          Category
          Status
          Source
          Language