ariofrio/oration

View on GitHub

Showing 63 of 71 total issues

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

def copy_required_modules(dst_prefix):
    import imp
    for modname in REQUIRED_MODULES:
        if modname in sys.builtin_module_names:
            logger.info("Ignoring built-in bootstrap module: %s" % modname)
Severity: Minor
Found in templates/azure/java/WorkerRole/virtualenv.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 _parse_entity has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse_entity(self, entry):
        entity = TableEntity()
        for property in (p for p in entry.getElementsByTagName("m:properties")[0].childNodes if p.nodeType == minidom.Node.ELEMENT_NODE):
            key = property.tagName[2:]
            if property.hasAttribute('m:type'):
Severity: Minor
Found in templates/azure/java/WorkerRole/app/winazurestorage.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 copy_required_modules has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def copy_required_modules(dst_prefix):
    import imp
    for modname in REQUIRED_MODULES:
        if modname in sys.builtin_module_names:
            logger.info("Ignoring built-in bootstrap module: %s" % modname)
Severity: Minor
Found in templates/azure/py/WorkerRole/virtualenv.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 _parse_entity has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse_entity(self, entry):
        entity = TableEntity()
        for property in (p for p in entry.getElementsByTagName("m:properties")[0].childNodes if p.nodeType == minidom.Node.ELEMENT_NODE):
            key = property.tagName[2:]
            if property.hasAttribute('m:type'):
Severity: Minor
Found in templates/azure/py/WorkerRole/app/winazurestorage.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 install_python has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
    """Install just the base environment, no distutils patches etc"""
    if sys.executable.startswith(bin_dir):
        print('Please use the *system* python to run this script')
        return
Severity: Minor
Found in templates/azure/py/WorkerRole/virtualenv.py - About 1 hr to fix

    Function install_python has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
        """Install just the base environment, no distutils patches etc"""
        if sys.executable.startswith(bin_dir):
            print('Please use the *system* python to run this script')
            return
    Severity: Minor
    Found in templates/azure/java/WorkerRole/virtualenv.py - About 1 hr to fix

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

          def list_blobs(self, container_name, blob_prefix=None):
              marker = None
              while True:
                  url = "%s/%s?restype=container&comp=list" % (self.get_base_url(), container_name)
                  if not blob_prefix is None: url += "&%s" % urlencode({"prefix": blob_prefix})
      Severity: Minor
      Found in templates/azure/py/WorkerRole/app/winazurestorage.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 list_blobs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def list_blobs(self, container_name, blob_prefix=None):
              marker = None
              while True:
                  url = "%s/%s?restype=container&comp=list" % (self.get_base_url(), container_name)
                  if not blob_prefix is None: url += "&%s" % urlencode({"prefix": blob_prefix})
      Severity: Minor
      Found in templates/azure/java/WorkerRole/app/winazurestorage.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 main has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def main():
          parser = optparse.OptionParser(
              version=virtualenv_version,
              usage="%prog [OPTIONS] DEST_DIR")
      
      
      Severity: Minor
      Found in templates/azure/py/WorkerRole/virtualenv.py - About 1 hr to fix

        Function main has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def main():
            parser = optparse.OptionParser(
                version=virtualenv_version,
                usage="%prog [OPTIONS] DEST_DIR")
        
        
        Severity: Minor
        Found in templates/azure/java/WorkerRole/virtualenv.py - About 1 hr to fix

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

          def filter_ez_setup(line, project_name='setuptools'):
              if not line.strip():
                  return Logger.DEBUG
              if project_name == 'distribute':
                  for prefix in ('Extracting', 'Now working', 'Installing', 'Before',
          Severity: Minor
          Found in templates/azure/py/WorkerRole/virtualenv.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 filter_ez_setup has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          def filter_ez_setup(line, project_name='setuptools'):
              if not line.strip():
                  return Logger.DEBUG
              if project_name == 'distribute':
                  for prefix in ('Extracting', 'Now working', 'Installing', 'Before',
          Severity: Minor
          Found in templates/azure/java/WorkerRole/virtualenv.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 create_environment has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def create_environment(home_dir, site_packages=True, clear=False,
          Severity: Major
          Found in templates/azure/java/WorkerRole/virtualenv.py - About 1 hr to fix

            Function create_environment has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def create_environment(home_dir, site_packages=True, clear=False,
            Severity: Major
            Found in templates/azure/py/WorkerRole/virtualenv.py - About 1 hr to fix

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

              def copyfile(src, dest, symlink=True):
                  if not os.path.exists(src):
                      # Some bad symlink in the src
                      logger.warn('Cannot find file %s (bad symlink)', src)
                      return
              Severity: Minor
              Found in templates/azure/java/WorkerRole/virtualenv.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 fixup_pth_file has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def fixup_pth_file(filename):
                  lines = []
                  prev_lines = []
                  f = open(filename)
                  prev_lines = f.readlines()
              Severity: Minor
              Found in templates/azure/py/WorkerRole/virtualenv.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 path_locations has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def path_locations(home_dir):
                  """Return the path locations for the environment (where libraries are,
                  where scripts go, etc)"""
                  # XXX: We'd use distutils.sysconfig.get_python_inc/lib but its
                  # prefix arg is broken: http://bugs.python.org/issue3386
              Severity: Minor
              Found in templates/azure/java/WorkerRole/virtualenv.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 path_locations has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def path_locations(home_dir):
                  """Return the path locations for the environment (where libraries are,
                  where scripts go, etc)"""
                  # XXX: We'd use distutils.sysconfig.get_python_inc/lib but its
                  # prefix arg is broken: http://bugs.python.org/issue3386
              Severity: Minor
              Found in templates/azure/py/WorkerRole/virtualenv.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 fixup_pth_file has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def fixup_pth_file(filename):
                  lines = []
                  prev_lines = []
                  f = open(filename)
                  prev_lines = f.readlines()
              Severity: Minor
              Found in templates/azure/java/WorkerRole/virtualenv.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 install_pip has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def install_pip(py_executable, search_dirs=None, never_download=False):    
                  if search_dirs is None:
                      search_dirs = file_search_dirs()
              
                  filenames = []
              Severity: Minor
              Found in templates/azure/py/WorkerRole/virtualenv.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

              Severity
              Category
              Status
              Source
              Language