andry81/tacklelib

View on GitHub

Showing 58 of 64 total issues

Avoid deeply nested control flow statements.
Open

              if retry_count % 10 == 0:
                # give to scheduler a break
                time.sleep(0.02)
              continue
Severity: Major
Found in python/tacklelib/tacklelib.cache.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  if retry_count % 10 == 0:
                    # give to scheduler a break
                    time.sleep(0.02)
                  continue
    Severity: Major
    Found in python/tacklelib/tacklelib.cache.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if var_value is None:
                    if not search_in_expand_dict_at_second is None:
                      var_value = search_in_expand_dict_at_second.get(var_name)
                      if var_value is None:
                        if not search_by_pred_at_third is None:
      Severity: Major
      Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if c.isspace():
                      has_spaces = True
                      break
        
        Severity: Major
        Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if is_module_ref_already_exist:
                      raise Exception('The module reference must not exist as a module before the import: ' + import_module_name)
                  elif module_must_exist:
          Severity: Major
          Found in python/tacklelib/tacklelib.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if not var_value is None:
                          var_value = var_value.replace('\\', '/')
                          if var_value is None:
                            if not search_in_expand_dict_at_second is None:
                              var_value = search_in_expand_dict_at_second.get(var_name)
            Severity: Major
            Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                        if 'nomergemodule' in target_module_attrs and target_module_attrs['nomergemodule']:
                          raise Exception('attempt to merge the module content to the existed module has been declared as not mergable: ' + target_module.__name__)
              
                      # export globals to a being imported module
                      for var, value in global_vars.items(): 
              Severity: Major
              Found in python/tacklelib/tacklelib.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if not var_value is None:
                              var_value = var_value.replace('\\', '/')
                              if var_value is None:
                                if not search_in_expand_dict_at_second is None:
                                  var_value = search_in_expand_dict_at_second.get(var_name)
                Severity: Major
                Found in python/tacklelib/tacklelib.yaml.py - About 45 mins to fix

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

                      if not isinstance(list_value, list):
                        raise Exception('list_value is not a list type' + str(type(list_value)))
                  Severity: Minor
                  Found in python/tacklelib/tacklelib.yaml.py and 1 other location - About 40 mins to fix
                  python/tacklelib/tacklelib.yaml.py on lines 264..265

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

                  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 key not in last_expanded_vars.keys() and key not in last_added_expanded_var_names:
                            last_added_expanded_var_names.append(key)
                  Severity: Minor
                  Found in python/tacklelib/tacklelib.yaml.py and 1 other location - About 40 mins to fix
                  python/tacklelib/tacklelib.yaml.py on lines 78..79

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

                  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 key not in last_unexpanded_vars.keys() and key not in last_added_unexpanded_var_names:
                            last_added_unexpanded_var_names.append(key)
                  Severity: Minor
                  Found in python/tacklelib/tacklelib.yaml.py and 1 other location - About 40 mins to fix
                  python/tacklelib/tacklelib.yaml.py on lines 285..286

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

                  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(dict_value, dict):
                        raise Exception('dict_value is not a dictionary type' + str(type(dict_value)))
                  Severity: Minor
                  Found in python/tacklelib/tacklelib.yaml.py and 1 other location - About 40 mins to fix
                  python/tacklelib/tacklelib.yaml.py on lines 204..205

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

                  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

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

                    def expand_dict(self, dict_value, search_in_expand_dict_at_second = None, search_by_pred_at_third = None, ignore_types = None, list_as_cmdline = False):
                  Severity: Minor
                  Found in python/tacklelib/tacklelib.yaml.py - About 35 mins to fix

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

                      def expand(self, search_in_expand_dict_at_second = None, search_by_pred_at_third = None, ignore_types = None, list_as_cmdline = False, update = False):
                    Severity: Minor
                    Found in python/tacklelib/tacklelib.yaml.py - About 35 mins to fix

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

                        def pop_unexpanded_vars(self, reexpand_vars, remove_pred = None, list_as_cmdline = False):
                          if len(self.unexpanded_stack) == 0:
                            raise Exception('unexpanded_stack is empty to pop')
                          last_stack_record = self.unexpanded_stack[-1]
                          self.unexpanded_vars = last_stack_record[0]
                      Severity: Minor
                      Found in python/tacklelib/tacklelib.yaml.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 __delitem__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __delitem__(self, key):
                              ekey = self._encode_key(key)
                              filename = self._key_to_filename(ekey)
                              if not self._sync:
                                  try:
                      Severity: Minor
                      Found in python_patches/fcache/cache.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 _rename has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def _rename(src, dst):
                                  if not isinstance(src, unicode):
                                      src = unicode(src, sys.getfilesystemencoding())
                                  if not isinstance(dst, unicode):
                                      dst = unicode(dst, sys.getfilesystemencoding())
                      Severity: Minor
                      Found in python_patches/fcache/posixemulation.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 pop_expanded_vars has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def pop_expanded_vars(self, remove_pred = None):
                          if len(self.expanded_stack) == 0:
                            raise Exception('expanded_stack is empty to pop')
                          last_stack_record = self.expanded_stack[-1]
                          self.expanded_vars = last_stack_record[0]
                      Severity: Minor
                      Found in python/tacklelib/tacklelib.yaml.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

                      Severity
                      Category
                      Status
                      Source
                      Language