tools/gyp/pylib/gyp/xcodeproj_file.py

Summary

Maintainability
F
2 wks
Test Coverage

File xcodeproj_file.py has 1903 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Xcode project file generator.
Severity: Major
Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 5 days to fix

    Function UpdateProperties has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

      def UpdateProperties(self, properties, do_copy=False):
        """Merge the supplied properties into the _properties dictionary.
    
        The input properties must adhere to the class schema or a KeyError or
        TypeError exception will be raised.  If adding an object of an XCObject
    Severity: Minor
    Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 1 day 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 a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

      def __init__(self, properties=None, id=None, parent=None,
                   force_outdir=None, force_prefix=None, force_extension=None):
        # super
        XCTarget.__init__(self, properties, id, parent)
    
    
    Severity: Minor
    Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 6 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 TakeOverOnlyChild has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

      def TakeOverOnlyChild(self, recurse=False):
        """If this PBXGroup has only one child and it's also a PBXGroup, take
        it over by making all of its children this object's children.
    
        This function will continue to take over only children when those children
    Severity: Minor
    Found in tools/gyp/pylib/gyp/xcodeproj_file.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 AddOrGetFileByPath has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

      def AddOrGetFileByPath(self, path, hierarchical):
        """Returns an existing or new file reference corresponding to path.
    
        If hierarchical is True, this method will create or use the necessary
        hierarchical group structure corresponding to path.  Otherwise, it will
    Severity: Minor
    Found in tools/gyp/pylib/gyp/xcodeproj_file.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 Copy has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

      def Copy(self):
        """Make a copy of this object.
    
        The new object will have its own copy of lists and dicts.  Any XCObject
        objects owned by this object (marked "strong") will be copied in the
    Severity: Minor
    Found in tools/gyp/pylib/gyp/xcodeproj_file.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 _XCPrintableValue has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

      def _XCPrintableValue(self, tabs, value, flatten_list=False):
        """Returns a representation of value that may be printed in a project file,
        mimicing Xcode's behavior.
    
        _XCPrintableValue can handle str and int values, XCObjects (which are
    Severity: Minor
    Found in tools/gyp/pylib/gyp/xcodeproj_file.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

    XCObject has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class XCObject(object):
      """The abstract base of all class types used in Xcode project files.
    
      Class variables:
        _schema: A dictionary defining the properties of this class.  The keys to
    Severity: Minor
    Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 3 hrs to fix

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

        def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None):
          """Set "id" properties deterministically.
      
          An object's "id" property is set based on a hash of its class type and
          name, as well as the class type and name of all ancestor objects.  As
      Severity: Minor
      Found in tools/gyp/pylib/gyp/xcodeproj_file.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

      Consider simplifying this complex logical expression.
      Open

          if isinstance(other, PBXNativeTarget) and \
             'productType' in self._properties and \
             self._properties['productType'] != static_library_type and \
             'productType' in other._properties and \
             (other._properties['productType'] == static_library_type or \
      Severity: Critical
      Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 1 hr to fix

        Function SortGroups has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          def SortGroups(self):
            # Sort the children of the mainGroup (like "Source" and "Products")
            # according to their defined order.
            self._properties['mainGroup']._properties['children'] = \
                sorted(self._properties['mainGroup']._properties['children'],
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def __init__(self, properties=None, id=None, parent=None):
            # super
            XCObject.__init__(self, properties, id, parent)
            if 'path' in self._properties and not 'name' in self._properties:
              path = self._properties['path']
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 _AddBuildFileToDicts has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def _AddBuildFileToDicts(self, pbxbuildfile, path=None):
            """Maintains the _files_by_path and _files_by_xcfilelikeelement dicts.
        
            If path is specified, then it is the path that is being added to the
            phase, and pbxbuildfile must contain either a PBXFileReference directly
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 _PrintObjects has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def _PrintObjects(self, file):
            if self._should_print_single_line:
              self._XCPrint(file, 0, 'objects = {')
            else:
              self._XCPrint(file, 1, 'objects = {\n')
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 HasBuildSetting has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          def HasBuildSetting(self, key):
            """Determines the state of a build setting in all XCBuildConfiguration
            child objects.
        
            If all child objects have key in their build settings, and the value is the
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 _XCKVPrint has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def _XCKVPrint(self, file, tabs, key, value):
            """Prints a key and value, members of an XCObject's _properties dictionary,
            to file.
        
            tabs is an int identifying the indentation level.  If the class'
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def __init__(self, properties=None, id=None, parent=None,
                       force_outdir=None, force_prefix=None, force_extension=None):
            # super
            XCRemoteObject.__init__(self, properties, id, parent)
        
        
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 SetDestination has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def SetDestination(self, path):
            """Set the dstSubfolderSpec and dstPath properties from path.
        
            path may be specified in the same notation used for XCHierarchicalElements,
            specifically, "$(DIR)/path".
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def __init__(self, properties=None, id=None, parent=None):
            # super
            XCFileLikeElement.__init__(self, properties, id, parent)
            if 'path' in self._properties and self._properties['path'].endswith('/'):
              self._properties['path'] = self._properties['path'][:-1]
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 AddOrGetProjectReference has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def AddOrGetProjectReference(self, other_pbxproject):
            """Add a reference to another project file (via PBXProject object) to this
            one.
        
            Returns [ProductGroup, ProjectRef].  ProductGroup is a PBXGroup object in
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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 AddDependency has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def AddDependency(self, other):
            # super
            XCTarget.AddDependency(self, other)
        
            static_library_type = 'com.apple.product-type.library.static'
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 45 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 Children has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def Children(self):
            """Returns a list of all of this object's owned (strong) children."""
        
            children = []
            for property, attributes in self._schema.iteritems():
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 45 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

        Avoid deeply nested control flow statements.
        Open

                    for item in value:
                      self._properties[property].append(item.Copy())
                  else:
        Severity: Major
        Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 45 mins to fix

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

            def __init__(self, properties=None, id=None, parent=None,
          Severity: Minor
          Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 45 mins to fix

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

              def __init__(self, properties=None, id=None, parent=None,
            Severity: Minor
            Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 45 mins to fix

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

                def GetBuildSetting(self, key):
                  """Gets the build setting for key.
              
                  All child XCConfiguration objects must have the same value set for the
                  setting, or a ValueError will be raised.
              Severity: Minor
              Found in tools/gyp/pylib/gyp/xcodeproj_file.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 HeadersPhase has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def HeadersPhase(self):
                  headers_phase = self.GetBuildPhaseByType(PBXHeadersBuildPhase)
                  if headers_phase is None:
                    headers_phase = PBXHeadersBuildPhase()
              
              
              Severity: Minor
              Found in tools/gyp/pylib/gyp/xcodeproj_file.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

              Avoid too many return statements within this function.
              Open

                  return 0
              Severity: Major
              Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return 1
                Severity: Major
                Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 30 mins to fix

                  Function ResourcesPhase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def ResourcesPhase(self):
                      resources_phase = self.GetBuildPhaseByType(PBXResourcesBuildPhase)
                      if resources_phase is None:
                        resources_phase = PBXResourcesBuildPhase()
                  
                  
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 25 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 _AddChildToDicts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def _AddChildToDicts(self, child):
                      # Sets up this PBXGroup object's dicts to reference the child properly.
                      child_path = child.PathFromSourceTreeAndPath()
                      if child_path:
                        if child_path in self._children_by_path:
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 25 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 FullPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def FullPath(self):
                      # Returns a full path to self relative to the project file, or relative
                      # to some other source tree.  Start with self, and walk up the chain of
                      # parents prepending their paths, if any, until no more parents are
                      # available (project-relative path) or until a path relative to some
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 25 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 SortRemoteProductReferences has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def SortRemoteProductReferences(self):
                      # For each remote project file, sort the associated ProductGroup in the
                      # same order that the targets are sorted in the remote project file.  This
                      # is the sort order used by Xcode.
                  
                  
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 25 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 GetChildByRemoteObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def GetChildByRemoteObject(self, remote_object):
                      # This method is a little bit esoteric.  Given a remote_object, which
                      # should be a PBXFileReference in another project file, this method will
                      # return this group's PBXReferenceProxy object serving as a local proxy
                      # for the remote PBXFileReference.
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 25 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 Print has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def Print(self, file=sys.stdout):
                      self.VerifyHasRequiredProperties()
                  
                      # Add the special "objects" property, which will be caught and handled
                      # separately during printing.  This structure allows a fairly standard
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 25 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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def __init__(self, properties=None, id=None, parent=None):
                      # super
                      XCObject.__init__(self, properties, id, parent)
                  
                      self._files_by_path = {}
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 3 hrs to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1113..1119

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def __init__(self, properties=None, id=None, parent=None):
                      # super
                      XCHierarchicalElement.__init__(self, properties, id, parent)
                      self._children_by_path = {}
                      self._variant_children_by_name_and_path = {}
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 3 hrs to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1757..1764

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      if not isinstance(value, property_type):
                        raise TypeError, 'item of ' + key + ' of ' + self.__class__.__name__ + \
                                         ' must be ' + property_type.__name__ + ', not ' + \
                                         value.__class__.__name__
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 2 hrs to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 769..776

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 57.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                            if not isinstance(item, property_type) and \
                               not (item.__class__ == unicode and property_type == str):
                              # Accept unicode where str is specified.  str is treated as
                              # UTF-8-encoded.
                              raise TypeError, \
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 2 hrs to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 845..848

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 57.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def FrameworksPhase(self):
                      frameworks_phase = self.GetBuildPhaseByType(PBXFrameworksBuildPhase)
                      if frameworks_phase is None:
                        frameworks_phase = PBXFrameworksBuildPhase()
                        self.AppendProperty('buildPhases', frameworks_phase)
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 2426..2432

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 47.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def SourcesPhase(self):
                      sources_phase = self.GetBuildPhaseByType(PBXSourcesBuildPhase)
                      if sources_phase is None:
                        sources_phase = PBXSourcesBuildPhase()
                        self.AppendProperty('buildPhases', sources_phase)
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 2434..2440

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 47.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          if file_ref != None:
                            assert file_ref.__class__ == PBXFileReference
                          else:
                            file_ref = PBXFileReference({'path': path})
                            self.AppendChild(file_ref)
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1299..1303

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 44.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        if group_ref != None:
                          assert group_ref.__class__ == PBXGroup
                        else:
                          group_ref = PBXGroup({'path': next_dir})
                          self.AppendChild(group_ref)
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1268..1272

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 44.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        elif isinstance(value, dict):
                          # dicts are never strong.
                          if is_strong:
                            raise TypeError, 'Strong dict for key ' + key + ' in ' + \
                                             self.__class__.__name__
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 804..809

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 43.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          elif isinstance(value, dict):
                            self._properties[property] = value.copy()
                          else:
                            raise TypeError, "Don't know how to copy a " + \
                                             value.__class__.__name__ + ' object for ' + \
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 341..350

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 43.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def Hashables(self):
                      # super
                      hashables = XCObject.Hashables(self)
                  
                      # It is not sufficient to just rely on Name() to get the
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 2105..2111

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 41.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def Hashables(self):
                      # super
                      hashables = XCObject.Hashables(self)
                  
                      # Use the hashables of the weak objects that this object refers to.
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1716..1728

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 41.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    _schema.update({
                      'explicitFileType':  [0, str, 0, 0],
                      'lastKnownFileType': [0, str, 0, 0],
                      'name':              [0, str, 0, 0],
                      'path':              [0, str, 0, 1],
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 2054..2058

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 39.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    _schema.update({
                      'containerPortal':      [0, XCContainerPortal, 0, 1],
                      'proxyType':            [0, int,               0, 1],
                      'remoteGlobalIDString': [0, XCRemoteObject,    0, 1],
                      'remoteInfo':           [0, str,               0, 1],
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1450..1454

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 39.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        elif not isinstance(value, property_type) and \
                             not (value.__class__ == unicode and property_type == str):
                  Severity: Major
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 769..770

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 38.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        if not property in self._schema:
                          raise KeyError, property + ' not in ' + self.__class__.__name__
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 55 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 839..840

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 37.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      if not key in self._schema:
                        raise KeyError, key + ' not in ' + self.__class__.__name__
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 55 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 758..759

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 37.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def SetBuildSetting(self, key, value):
                      """Sets the build setting for key to value in all child
                      XCBuildConfiguration objects.
                      """
                  
                  
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 45 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1677..1683

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 35.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def AppendBuildSetting(self, key, value):
                      """Appends value to the build setting for key, which is treated as a list,
                      in all child XCBuildConfiguration objects.
                      """
                  
                  
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 45 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1669..1675

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 35.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  class PBXResourcesBuildPhase(XCBuildPhase):
                    # No additions to the schema relative to XCBuildPhase.
                  
                    def Name(self):
                      return 'Resources'
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 2 other locations - About 35 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1870..1877
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1890..1897

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  class PBXSourcesBuildPhase(XCBuildPhase):
                    # No additions to the schema relative to XCBuildPhase.
                  
                    def Name(self):
                      return 'Sources'
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 2 other locations - About 35 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1870..1877
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1880..1887

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  class PBXHeadersBuildPhase(XCBuildPhase):
                    # No additions to the schema relative to XCBuildPhase.
                  
                    def Name(self):
                      return 'Headers'
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 2 other locations - About 35 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1880..1887
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1890..1897

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def DelBuildSetting(self, key):
                      """Deletes the build setting key from all child XCBuildConfiguration
                      objects.
                      """
                  
                  
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 35 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1693..1698

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def SetBaseConfiguration(self, value):
                      """Sets the build configuration in all child XCBuildConfiguration objects.
                      """
                  
                      for configuration in self._properties['buildConfigurations']:
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 35 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1685..1691

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          (not 'sourceTree' in self._properties or \
                           self._properties['sourceTree'] == '<group>'):
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 30 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1367..1368

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 32.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    _schema.update({
                      'fileType':  [0, str,                   0, 1],
                      'path':      [0, str,                   0, 1],
                      'remoteRef': [0, PBXContainerItemProxy, 1, 1],
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 30 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1939..1942

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 32.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    _schema.update({
                      'dstPath':          [0, str, 0, 1],
                      'dstSubfolderSpec': [0, int, 0, 1],
                      'name':             [0, str, 0, 0],
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 30 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 2116..2119

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 32.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def Name(self):
                      if 'name' in self._properties:
                        return self._properties['name']
                  
                      return 'ShellScript'
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 30 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1965..1969

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 32.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                        if not 'sourceTree' in self._properties or \
                           self._properties['sourceTree'] == '<group>':
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 30 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 925..926

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 32.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    def Name(self):
                      if 'name' in self._properties:
                        return self._properties['name']
                  
                      return 'CopyFiles'
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 30 mins to fix
                  tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1930..1934

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 32.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status