ariofrio/oration

View on GitHub

Showing 71 of 71 total issues

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

      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/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 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 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/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/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 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 call_subprocess has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def call_subprocess(cmd, show_stdout=True,
      Severity: Major
      Found in templates/azure/java/WorkerRole/virtualenv.py - About 50 mins to fix

        Function call_subprocess has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def call_subprocess(cmd, show_stdout=True,
        Severity: Major
        Found in templates/azure/py/WorkerRole/virtualenv.py - About 50 mins to fix

          Function install_python has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
          Severity: Minor
          Found in templates/azure/java/WorkerRole/virtualenv.py - About 45 mins to fix

            Function writefile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def writefile(dest, content, overwrite=True):
                if not os.path.exists(dest):
                    logger.info('Writing %s', dest)
                    f = open(dest, 'wb')
                    f.write(content.encode('utf-8'))
            Severity: Minor
            Found in templates/azure/py/WorkerRole/virtualenv.py - About 45 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_python has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
            Severity: Minor
            Found in templates/azure/py/WorkerRole/virtualenv.py - About 45 mins to fix

              Function writefile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def writefile(dest, content, overwrite=True):
                  if not os.path.exists(dest):
                      logger.info('Writing %s', dest)
                      f = open(dest, 'wb')
                      f.write(content.encode('utf-8'))
              Severity: Minor
              Found in templates/azure/java/WorkerRole/virtualenv.py - About 45 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_activate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def install_activate(home_dir, bin_dir, prompt=None):
                  if sys.platform == 'win32' or is_jython and os._name == 'nt':
                      files = {'activate.bat': ACTIVATE_BAT,
                               'deactivate.bat': DEACTIVATE_BAT}
                      if os.environ.get('OS') == 'Windows_NT' and os.environ.get('OSTYPE') == 'cygwin':
              Severity: Minor
              Found in templates/azure/java/WorkerRole/virtualenv.py - About 45 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_activate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def install_activate(home_dir, bin_dir, prompt=None):
                  if sys.platform == 'win32' or is_jython and os._name == 'nt':
                      files = {'activate.bat': ACTIVATE_BAT,
                               'deactivate.bat': DEACTIVATE_BAT}
                      if os.environ.get('OS') == 'Windows_NT' and os.environ.get('OSTYPE') == 'cygwin':
              Severity: Minor
              Found in templates/azure/py/WorkerRole/virtualenv.py - About 45 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 resolve_interpreter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def resolve_interpreter(exe):
                  """
                  If the executable given isn't an absolute path, search $PATH for the interpreter
                  """
                  if os.path.abspath(exe) != exe:
              Severity: Minor
              Found in templates/azure/py/WorkerRole/virtualenv.py - About 45 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 resolve_interpreter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def resolve_interpreter(exe):
                  """
                  If the executable given isn't an absolute path, search $PATH for the interpreter
                  """
                  if os.path.abspath(exe) != exe:
              Severity: Minor
              Found in templates/azure/java/WorkerRole/virtualenv.py - About 45 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