hackedteam/vector-edk

View on GitHub

Showing 9,525 of 13,510 total issues

Function patch has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def patch():
  global vol_address
  global vol_size

  print 'Patching volume'
Severity: Major
Found in vector-uefi/fd/tool/test.py - About 2 hrs to fix

    Function patch has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def patch():
      global vol_address
      global vol_size
    
      print 'Patching volume'
    Severity: Major
    Found in vector-uefi/fd/tool/flash.py - About 2 hrs to fix

      File bgenGenerator.py has 253 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from bgenOutput import *
      from bgenType import *
      from bgenVariable import *
      
      

        File rcslib.py has 253 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """RCS interface module.
        
        Defines the class RCS, which represents a directory with rcs version
        files and (possibly) corresponding work files.
        
        Severity: Minor
        Found in AppPkg/Applications/Python/Python-2.7.2/Demo/pdist/rcslib.py - About 2 hrs to fix

          File firmware_volume.py has 252 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #
          #  Copyright (c) 2011-2013, ARM Limited. All rights reserved.
          #  
          #  This program and the accompanying materials                          
          #  are licensed and made available under the terms and conditions of the BSD License         
          Severity: Minor
          Found in ArmPlatformPkg/Scripts/Ds5/firmware_volume.py - About 2 hrs to fix

            File astgen.py has 252 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """Generate ast module from specification
            
            This script generates the ast module from a simple specification,
            which makes it easy to accomodate changes in the grammar.  This
            approach would be quite reasonable if the grammar changed often.
            Severity: Minor
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/compiler/astgen.py - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                          if self.__CurrentChar() == T_CHAR_LF:
                              self.CurrentLineNumber += 1
                              self.CurrentOffsetWithinLine = 0
                              if InComment and DoubleSlashComment:
                                  InComment = False
              Severity: Critical
              Found in BaseTools/Source/Python/Common/FdfParserLite.py - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                            if self.__CurrentChar() == T_CHAR_LF:
                                self.CurrentLineNumber += 1
                                self.CurrentOffsetWithinLine = 0
                                if InComment and DoubleSlashComment:
                                    InComment = False
                Severity: Critical
                Found in BaseTools/Source/Python/GenFds/FdfParser.py - About 2 hrs to fix

                  Function _Init has 16 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _Init(self, WorkspaceDir, ActivePlatform, Target, Toolchain, ArchList, MetaFileDb,
                  Severity: Major
                  Found in BaseTools/Source/Python/AutoGen/AutoGen.py - About 2 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                                if LA106 == 58:
                                    LA106_2 = self.input.LA(2)
                    
                                    if (self.synpred33()) :
                                        alt106 = 1
                    Severity: Critical
                    Found in BaseTools/Source/Python/Ecc/CParser.py - About 2 hrs to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if LA106 == 58:
                                      LA106_2 = self.input.LA(2)
                      
                                      if (self.synpred33()) :
                                          alt106 = 1
                      Severity: Critical
                      Found in BaseTools/Source/Python/Eot/CParser.py - About 2 hrs to fix

                        Function __init__ has 16 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(self, ID = -1, Header = '', Modifier = '', Name = '', ReturnStatement = '', \
                        Severity: Major
                        Found in BaseTools/Source/Python/CommonDataClass/DataClass.py - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if (not skipkeys and ensure_ascii and
                                  check_circular and allow_nan and
                                  cls is None and indent is None and separators is None and
                                  encoding == 'utf-8' and default is None and not kw):
                                  return _default_encoder.encode(obj)
                          Severity: Critical
                          Found in AppPkg/Applications/Python/Python-2.7.2/Lib/json/__init__.py - About 2 hrs to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if (not skipkeys and ensure_ascii and
                                    check_circular and allow_nan and
                                    cls is None and indent is None and separators is None and
                                    encoding == 'utf-8' and default is None and not kw):
                                    iterable = _default_encoder.iterencode(obj)
                            Severity: Critical
                            Found in AppPkg/Applications/Python/Python-2.7.2/Lib/json/__init__.py - About 2 hrs to fix

                              Function parse_graminit_c has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def parse_graminit_c(self, filename):
                                      """Parse the .c file written by pgen.  (Internal)
                              
                                      The file looks as follows.  The first two lines are always this:
                              
                              Severity: Minor
                              Found in AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/pgen2/conv.py - About 2 hrs to fix

                                Consider simplifying this complex logical expression.
                                Open

                                    if (not skipkeys and ensure_ascii and
                                        check_circular and allow_nan and
                                        cls is None and indent is None and separators is None and
                                        encoding == 'utf-8' and default is None and not kw):
                                        return _default_encoder.encode(obj)
                                Severity: Critical
                                Found in vector-uefi/fd/efi/StdLib/lib/python.27/json/__init__.py - About 2 hrs to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if (not skipkeys and ensure_ascii and
                                          check_circular and allow_nan and
                                          cls is None and indent is None and separators is None and
                                          encoding == 'utf-8' and default is None and not kw):
                                          iterable = _default_encoder.iterencode(obj)
                                  Severity: Critical
                                  Found in vector-uefi/fd/efi/StdLib/lib/python.27/json/__init__.py - About 2 hrs to fix

                                    Function parse_graminit_c has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def parse_graminit_c(self, filename):
                                            """Parse the .c file written by pgen.  (Internal)
                                    
                                            The file looks as follows.  The first two lines are always this:
                                    
                                    Severity: Minor
                                    Found in vector-uefi/fd/efi/StdLib/lib/python.27/lib2to3/pgen2/conv.py - About 2 hrs to fix

                                      Function __GetFilePart has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          def __GetFilePart(self, FfsFileObj, MacroDict = {}):
                                              
                                              self.__GetFileOpts( FfsFileObj)
                                              
                                              if not self.__IsToken("{"):
                                      Severity: Minor
                                      Found in BaseTools/Source/Python/Common/FdfParserLite.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 GetFiles has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      def GetFiles(Root, SkipList=None, FullPath = True):
                                          OriPath = Root
                                          FileList = []
                                          for Root, Dirs, Files in os.walk(Root):
                                              if SkipList:
                                      Severity: Minor
                                      Found in BaseTools/Source/Python/Common/Misc.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