hackedteam/core-android-market

View on GitHub
src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py

Summary

Maintainability
F
1 wk
Test Coverage

Function x_build_action has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    def x_build_action( self, node ):
        test_run = self.results.documentElement
        action_node = node
        name = self.get_child(action_node,tag='name')
        if name:

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

    def add_log(self):
        if self.input[0]:
            bjam_xml = self.input[0]
        else:
            bjam_xml = self.input[1]

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

File process_jam_log.py has 378 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/python
# Copyright 2008 Rene Rivera
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

    Function get_sibling has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_sibling( self, sibling, tag = None, id = None, name = None, type = None ):
            n = sibling
            while n:
                found = True
                if type and found:

    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

    BJamLog2Results has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class BJamLog2Results:
    
        def __init__(self,args=None):
            opt = optparse.OptionParser(
                usage="%prog [options] input")

      Function get_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_data( self, node, strip = False, default = None ):
              data = None
              if node:
                  data_node = None
                  if not data_node:

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

          def x(self, *context, **kwargs):
              node = None
              names = [ ]
              for c in context:
                  if c:

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

          def x_name_(self, *context, **kwargs):
              node = None
              names = [ ]
              for c in context:
                  if c:

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

          def new_node( self, tag, *child, **kwargs ):
              result = self.results.createElement(tag)
              for k in kwargs.keys():
                  if kwargs[k] != '':
                      if k == 'id':

      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 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def __init__(self,args=None):
              opt = optparse.OptionParser(
                  usage="%prog [options] input")
              opt.add_option( '--output',
                  help="output file" )

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

            def get_test( self, node, type = None ):
                jam_target = self.get_child_data(node,tag='jam-target')
                base = self.target[jam_target]['name']
                target = jam_target
                while target in self.parent:
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.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 get_child_data has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def get_child_data( self, root, tag = None, id = None, name = None, strip = False, default = None ):
        Severity: Minor
        Found in src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if items:
                                      for item in items:
                                          if item:
                                              test_run.appendChild(self.results.createTextNode("\n"))
                                              test_run.appendChild(item)
          Severity: Major
          Found in src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if action_node.getAttribute('status') != '0':
                                        result = 'fail'
                                else:
            Severity: Major
            Found in src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py - About 45 mins to fix

              Function get_sibling has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def get_sibling( self, sibling, tag = None, id = None, name = None, type = None ):
              Severity: Minor
              Found in src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py - About 35 mins to fix

                Function get_child has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def get_child( self, root, tag = None, id = None, name = None, type = None ):
                Severity: Minor
                Found in src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py - About 35 mins to fix

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

                          for c in context:
                              if c:
                                  if not isinstance(c,xml.dom.Node):
                                      suffix = '_'+c.replace('-','_').replace('#','_')
                                  else:
                  src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py on lines 145..153

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

                  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 c in context:
                              if c:
                                  if not isinstance(c,xml.dom.Node):
                                      suffix = '_'+c.replace('-','_').replace('#','_')
                                  else:
                  src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py on lines 127..135

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

                  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 id and found:
                                  if n.hasAttribute('id'):
                                      found = found and n.getAttribute('id') == id
                                  else:
                                      found = found and n.hasAttribute('id') and n.getAttribute('id') == id
                  src/libbson/boost/boost_1_53_0/tools/build/v2/tools/doxproc.py on lines 769..773

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

                  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 new_text( self, tag, data, **kwargs ):
                          result = self.new_node(tag,**kwargs)
                          data = data.strip()
                          if len(data) > 0:
                              result.appendChild(self.results.createTextNode(data))
                  src/libbson/boost/boost_1_53_0/tools/build/v2/tools/doxproc.py on lines 820..825

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

                  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 items:
                              for item in items:
                                  if item:
                                      test_run.appendChild(self.results.createTextNode("\n"))
                                      test_run.appendChild(item)
                  src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py on lines 98..102

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

                  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 items:
                                              for item in items:
                                                  if item:
                                                      test_run.appendChild(self.results.createTextNode("\n"))
                                                      test_run.appendChild(item)
                  src/libbson/boost/boost_1_53_0/tools/regression/src/process_jam_log.py on lines 107..111

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

                  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 name and found:
                                  found = found and n.hasAttribute('name') and n.getAttribute('name') == name
                  src/libbson/boost/boost_1_53_0/tools/build/v2/tools/doxproc.py on lines 774..775

                  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

                  There are no issues that match your filters.

                  Category
                  Status