hackedteam/vector-edk

View on GitHub
AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py

Summary

Maintainability
F
1 wk
Test Coverage

File libpython.py has 1078 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python
'''
From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb
to be extended with Python code e.g. for library-specific data visualizations,
such as for the C++ STL types.  Documentation on this API can be seen at:
Severity: Major
Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 2 days to fix

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

    def move_in_stack(move_up):
        '''Move up or down the stack (for the py-up/py-down command)'''
        frame = Frame.get_selected_python_frame()
        while frame:
            if move_up:
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def subclass_from_type(cls, t):
            '''
            Given a PyTypeObjectPtr instance wrapping a gdb.Value that's a
            (PyTypeObject*), determine the corresponding subclass of PyObjectPtr
            to use
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def proxyval(self, visited):
            # From unicodeobject.h:
            #     Py_ssize_t length;  /* Length of raw Unicode data in buffer */
            #     Py_UNICODE *str;    /* Raw Unicode buffer */
            field_length = long(self.field('length'))
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        def write_repr(self, out, visited):
            out.write(self.safe_tp_name())
    
            # Guard against infinite loops:
            if self.as_address() in visited:
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function get_var_by_name has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_var_by_name(self, name):
            '''
            Look for the named local variable, returning a (PyObjectPtr, scope) pair
            where scope is a string 'local', 'global', 'builtin'
    
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.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 invoke has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def invoke(self, args, from_tty):
            import re
    
            start = None
            end = None
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.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 proxyval has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def proxyval(self, visited):
            # Guard against infinite loops:
            if self.as_address() in visited:
                return ProxyAlreadyVisited('%s(...)' % self.safe_tp_name())
            visited.add(self.as_address())
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.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 _write_instance_repr has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _write_instance_repr(out, visited, name, pyop_attrdict, address):
    Severity: Minor
    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 35 mins to fix

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

          def get_attr_dict(self):
              '''
              Get the PyDictObject ptr representing the attribute dictionary
              (or None if there's a problem)
              '''
      Severity: Minor
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.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 PyDictObjectPtr
      Severity: Major
      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return PyBaseExceptionObjectPtr
        Severity: Major
        Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return PyTupleObjectPtr
          Severity: Major
          Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return PyListObjectPtr
            Severity: Major
            Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return cls
              Severity: Major
              Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return PyLongObjectPtr
                Severity: Major
                Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return PyUnicodeObjectPtr
                  Severity: Major
                  Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return PyStringObjectPtr
                    Severity: Major
                    Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py - About 30 mins to fix

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

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

                      def _write_instance_repr(out, visited, name, pyop_attrdict, address):
                          '''Shared code for use by old-style and new-style classes:
                          write a representation to file-like object "out"'''
                          out.write('<')
                          out.write(name)
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.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

                              for pyop_arg, pyop_val in pyop_attrdict.iteritems():
                                  if not first:
                                      out.write(', ')
                                  first = False
                                  out.write(pyop_arg.proxyval(visited))
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 902..909

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

                      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

                              for pyop_name, pyop_value in self.iter_locals():
                                  if not first:
                                      out.write(', ')
                                  first = False
                      
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 384..390

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

                      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

                              for i in safe_range(int_from_int(self.field('ob_size'))):
                                  if i > 0:
                                      out.write(', ')
                                  element = PyObjectPtr.from_pyobject_ptr(self[i])
                                  element.write_repr(out, visited)
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 728..732

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

                      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

                              for i in safe_range(int_from_int(self.field('ob_size'))):
                                  if i > 0:
                                      out.write(', ')
                                  element = PyObjectPtr.from_pyobject_ptr(self[i])
                                  element.write_repr(out, visited)
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 1000..1004

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

                      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

                      class PyUp(gdb.Command):
                          'Select and print the python stack frame that called this one (if any)'
                          def __init__(self):
                              gdb.Command.__init__ (self,
                                                    "py-up",
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 1351..1361

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

                      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

                      class PyDown(gdb.Command):
                          'Select and print the python stack frame called by this one (if any)'
                          def __init__(self):
                              gdb.Command.__init__ (self,
                                                    "py-down",
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 1339..1349

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

                      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

                      class ProxyException(Exception):
                          def __init__(self, tp_name, args):
                              self.tp_name = tp_name
                              self.args = args
                      
                      AppPkg/Applications/Python/Python-2.7.2/Parser/asdl.py on lines 242..248

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

                      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

                              result = tuple([PyObjectPtr.from_pyobject_ptr(self[i]).proxyval(visited)
                                              for i in safe_range(int_from_int(self.field('ob_size')))])
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 716..717

                      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

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

                              result = [PyObjectPtr.from_pyobject_ptr(self[i]).proxyval(visited)
                                        for i in safe_range(int_from_int(self.field('ob_size')))]
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 988..989

                      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 3 locations. Consider refactoring.
                      Open

                              for pyop_name, pyop_value in self.iter_globals():
                                  if name == pyop_name.proxyval(set()):
                                      return pyop_value, 'global'
                      Severity: Major
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py and 2 other locations - About 55 mins to fix
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 846..848
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 852..854

                      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 3 locations. Consider refactoring.
                      Open

                              for pyop_name, pyop_value in self.iter_builtins():
                                  if name == pyop_name.proxyval(set()):
                                      return pyop_value, 'builtin'
                      Severity: Major
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py and 2 other locations - About 55 mins to fix
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 846..848
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 849..851

                      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 3 locations. Consider refactoring.
                      Open

                              for pyop_name, pyop_value in self.iter_locals():
                                  if name == pyop_name.proxyval(set()):
                                      return pyop_value, 'local'
                      Severity: Major
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py and 2 other locations - About 55 mins to fix
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 849..851
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 852..854

                      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 iter_globals(self):
                              '''
                              Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
                              the global variables of this frame
                              '''
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py and 1 other location - About 50 mins to fix
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 828..837

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

                      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 iter_builtins(self):
                              '''
                              Yield a sequence of (name,value) pairs of PyObjectPtr instances, for
                              the builtin variables
                              '''
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py and 1 other location - About 50 mins to fix
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 817..826

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

                      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 newer(self):
                              newer = self._gdbframe.newer()
                              if newer:
                                  return Frame(newer)
                              else:
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py and 1 other location - About 30 mins to fix
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 1152..1157

                      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 older(self):
                              older = self._gdbframe.older()
                              if older:
                                  return Frame(older)
                              else:
                      Severity: Minor
                      Found in AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py and 1 other location - About 30 mins to fix
                      AppPkg/Applications/Python/Python-2.7.2/Tools/gdb/libpython.py on lines 1159..1164

                      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