hackedteam/vector-edk

View on GitHub
AppPkg/Applications/Python/Python-2.7.2/Lib/distutils/command/build_ext.py

Summary

Maintainability
F
1 mo
Test Coverage

File build_ext.py has 490 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""distutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""

    Function finalize_options has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
    Open

        def finalize_options(self):
            from distutils import sysconfig
    
            self.set_undefined_options('build',
                                       ('build_lib', 'build_lib'),

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function check_extensions_list has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_extensions_list(self, extensions):
            """Ensure that the list of extensions (presumably provided as a
            command option 'extensions') is valid, i.e. it is a list of
            Extension objects.  We also support the old-style list of 2-tuples,
            where the tuples are (ext_name, build_info), which are converted to

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

        def get_libraries (self, ext):
            """Return the list of libraries to link against when building a
            shared extension.  On most platforms, this is just 'ext.libraries';
            on Windows and OS/2, we add the Python library (eg. python20.dll).
            """

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

        def run(self):
            from distutils.ccompiler import new_compiler
    
            # 'self.extensions', as supplied by setup.py, is a list of
            # Extension instances.  See the documentation for Extension (in

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

        def swig_sources (self, sources, extension):
    
            """Walk the list of source files in 'sources', looking for SWIG
            interface (.i) files.  Run SWIG on all that are found, and
            return a modified 'sources' list with SWIG source files replaced

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function find_swig has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        def find_swig (self):
            """Return the name of the SWIG executable.  On Unix, this is
            just "swig" -- it should be in the PATH.  Tries a bit harder on
            Windows.
            """

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

        def build_extension(self, ext):
            sources = ext.sources
            if sources is None or type(sources) not in (ListType, TupleType):
                raise DistutilsSetupError, \
                      ("in 'ext_modules' option (extension '%s'), " +

    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 ext.libraries

      Avoid too many return statements within this function.
      Open

                      return ext.libraries

        Avoid too many return statements within this function.
        Open

                    return ext.libraries + [pythonlib, "m"] + extra

          Avoid too many return statements within this function.
          Open

                          return ext.libraries + [pythonlib]

            Avoid too many return statements within this function.
            Open

                        return ext.libraries

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

              vector-uefi/fd/efi/StdLib/lib/python.27/distutils/command/build_ext.py on lines 0..767

              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 4066.

              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