ariofrio/oration

View on GitHub

Showing 63 of 71 total issues

File virtualenv.py has 1566 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
"""Create a "virtual" Python installation
"""

# If you change the version here, change it in setup.py 
Severity: Major
Found in templates/azure/java/WorkerRole/virtualenv.py - About 4 days to fix

    File virtualenv.py has 1566 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    """Create a "virtual" Python installation
    """
    
    # If you change the version here, change it in setup.py 
    Severity: Major
    Found in templates/azure/py/WorkerRole/virtualenv.py - About 4 days to fix

      Function install_python has a Cognitive Complexity of 89 (exceeds 5 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 day 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 a Cognitive Complexity of 89 (exceeds 5 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 day 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 a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

      def call_subprocess(cmd, show_stdout=True,
                          filter_stdout=None, cwd=None,
                          raise_on_returncode=True, extra_env=None,
                          remove_from_env=None):
          cmd_parts = []
      Severity: Minor
      Found in templates/azure/py/WorkerRole/virtualenv.py - About 6 hrs 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 a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

      def call_subprocess(cmd, show_stdout=True,
                          filter_stdout=None, cwd=None,
                          raise_on_returncode=True, extra_env=None,
                          remove_from_env=None):
          cmd_parts = []
      Severity: Minor
      Found in templates/azure/java/WorkerRole/virtualenv.py - About 6 hrs 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_req has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      def _install_req(py_executable, unzip=False, distribute=False,
                       search_dirs=None, never_download=False):
      
          if search_dirs is None:
              search_dirs = file_search_dirs()
      Severity: Minor
      Found in templates/azure/py/WorkerRole/virtualenv.py - About 5 hrs 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_req has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      def _install_req(py_executable, unzip=False, distribute=False,
                       search_dirs=None, never_download=False):
      
          if search_dirs is None:
              search_dirs = file_search_dirs()
      Severity: Minor
      Found in templates/azure/java/WorkerRole/virtualenv.py - About 5 hrs 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_and_egg_link has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

      def fixup_pth_and_egg_link(home_dir, sys_path=None):
          """Makes .pth and .egg-link files use relative paths"""
          home_dir = os.path.normcase(os.path.abspath(home_dir))
          if sys_path is None:
              sys_path = sys.path
      Severity: Minor
      Found in templates/azure/java/WorkerRole/virtualenv.py - About 3 hrs 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_and_egg_link has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

      def fixup_pth_and_egg_link(home_dir, sys_path=None):
          """Makes .pth and .egg-link files use relative paths"""
          home_dir = os.path.normcase(os.path.abspath(home_dir))
          if sys_path is None:
              sys_path = sys.path
      Severity: Minor
      Found in templates/azure/py/WorkerRole/virtualenv.py - About 3 hrs 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

      File winazurestorage.py has 318 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env python
      # encoding: utf-8
      """
      Python wrapper around Windows Azure storage
      Sriram Krishnan <sriramk@microsoft.com>
      Severity: Minor
      Found in templates/azure/java/WorkerRole/app/winazurestorage.py - About 3 hrs to fix

        File winazurestorage.py has 318 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #!/usr/bin/env python
        # encoding: utf-8
        """
        Python wrapper around Windows Azure storage
        Sriram Krishnan <sriramk@microsoft.com>
        Severity: Minor
        Found in templates/azure/py/WorkerRole/app/winazurestorage.py - About 3 hrs to fix

          Function log has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              def log(self, level, msg, *args, **kw):
                  if args:
                      if kw:
                          raise TypeError(
                              "You may give positional or keyword arguments, not both")
          Severity: Minor
          Found in templates/azure/java/WorkerRole/virtualenv.py - About 3 hrs 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 log has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

              def log(self, level, msg, *args, **kw):
                  if args:
                      if kw:
                          raise TypeError(
                              "You may give positional or keyword arguments, not both")
          Severity: Minor
          Found in templates/azure/py/WorkerRole/virtualenv.py - About 3 hrs 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 _sign_request_impl has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              def _sign_request_impl(self, request, for_tables = False,  use_path_style_uris = None):
                  (scheme, host, path, query, fragment) = urlsplit(request.get_full_url())
                  if use_path_style_uris:
                      path = path[path.index('/'):]
          
          
          Severity: Minor
          Found in templates/azure/java/WorkerRole/app/winazurestorage.py - About 2 hrs 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 _sign_request_impl has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              def _sign_request_impl(self, request, for_tables = False,  use_path_style_uris = None):
                  (scheme, host, path, query, fragment) = urlsplit(request.get_full_url())
                  if use_path_style_uris:
                      path = path[path.index('/'):]
          
          
          Severity: Minor
          Found in templates/azure/py/WorkerRole/app/winazurestorage.py - About 2 hrs 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 a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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_scripts has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          def fixup_scripts(home_dir):
              # This is what we expect at the top of scripts:
              shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir))
              # This is what we'll put:
              new_shebang = '#!/usr/bin/env python%s' % sys.version[:3]
          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 fixup_scripts has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          def fixup_scripts(home_dir):
              # This is what we expect at the top of scripts:
              shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir))
              # This is what we'll put:
              new_shebang = '#!/usr/bin/env python%s' % sys.version[:3]
          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

          Severity
          Category
          Status
          Source
          Language