cloudmatrix/esky

View on GitHub
esky/__init__.py

Summary

Maintainability
F
1 wk
Test Coverage

File __init__.py has 816 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#  Copyright (c) 2009-2010, Cloud Matrix Pty. Ltd.
#  All rights reserved; available under the terms of the BSD License.
"""

Esky  - keep frozen apps fresh
Severity: Major
Found in esky/__init__.py - About 1 day to fix

    Function _cleanup_actions has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
    Open

        def _cleanup_actions(self):
            """Iterator giving (func,args,kwds) tuples of cleanup actions.
    
            This encapsulates the logic of the "cleanup" method without actually
            performing any of the actions, making it easy to check whether cleanup
    Severity: Minor
    Found in esky/__init__.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 cleanup_at_exit has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

        def cleanup_at_exit(self):
            """Arrange for cleanup to occur after application exit.
    
            This operates by using the atexit module to spawn a new instance of
            this app, with appropriate flags that cause it to launch directly into
    Severity: Minor
    Found in esky/__init__.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 uninstall_version has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def uninstall_version(self, version):
            """Uninstall the specified version of the app."""
            if self.sudo_proxy is not None:
                return self.sudo_proxy.uninstall_version(version)
            vsdir = self._get_versions_dir()
    Severity: Minor
    Found in esky/__init__.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

    Esky has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Esky(object):
        """Class representing an updatable frozen app.
    
        Instances of this class point to a directory containing a frozen app in
        the esky format.  Through such an instance the app can be updated to a
    Severity: Minor
    Found in esky/__init__.py - About 3 hrs to fix

      Function lock has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          def lock(self, num_retries=0):
              """Lock the application directory for exclusive write access.
      
              If the appdir is already locked by another process/thread then
              EskyLockedError is raised.  There is no way to perform a blocking
      Severity: Minor
      Found in esky/__init__.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 auto_update has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def auto_update(self, callback=None):
              """Automatically install the latest version of the app.
      
              This method automatically performs the following sequence of actions,
              escalating to root privileges if a permission error is encountered:
      Severity: Minor
      Found in esky/__init__.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 _unpack_bootstrap_env has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def _unpack_bootstrap_env(self, target, trn):
              """Unpack the bootstrap env from the given target directory."""
              vdir = os.path.basename(target)
              #  Move new bootrapping environment into main app dir.
              #  Be sure to move dependencies before executables.
      Severity: Minor
      Found in esky/__init__.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 _try_remove has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          def _try_remove(self, tdir, path, manifest=[]):
              """Try to remove the file/directory at given path in the target dir.
      
              This method attempts to remove the file or directory at the given path,
              but will fail silently under a number of conditions:
      Severity: Minor
      Found in esky/__init__.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 _cleanup_bootstrap_env has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          def _cleanup_bootstrap_env(self, version, trn):
              """Cleanup the bootstrap env populated by the given version."""
              target_name = join_app_version(self.name, version, self.platform)
              #  Get set of all files that must stay in the main appdir
              to_keep = set()
      Severity: Minor
      Found in esky/__init__.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 cleanup has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          def cleanup(self):
              """Perform cleanup tasks in the app directory.
      
              This includes removing older versions of the app and completing any
              failed update attempts.  Such maintenance is not done automatically
      Severity: Minor
      Found in esky/__init__.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_version has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def install_version(self, version):
              """Install the specified version of the app.
      
              This fetches the specified version if necessary, then makes it
              available as a version directory inside the app directory.  It
      Severity: Minor
      Found in esky/__init__.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 fetch_version_iter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def fetch_version_iter(self, version):
              """Fetch specified version of the app, with iterator control flow."""
              if self.sudo_proxy is not None:
                  for status in self.sudo_proxy.fetch_version_iter(version):
                      yield status
      Severity: Minor
      Found in esky/__init__.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 run_startup_hooks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def run_startup_hooks():
          global _startup_hooks_were_run
          _startup_hooks_were_run = True
          # Lock the version dir while we're executing, so other instances don't
          # delete files out from under us.
      Severity: Minor
      Found in esky/__init__.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 fetch_version has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def fetch_version(self, version, callback=None):
              """Fetch the specified updated version of the app."""
              if self.sudo_proxy is not None:
                  for status in self.sudo_proxy.fetch_version_iter(version):
                      if callback is not None:
      Severity: Minor
      Found in esky/__init__.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 unlock has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def unlock(self):
              """Unlock the application directory for exclusive write access."""
              if self.sudo_proxy is not None:
                  return self.sudo_proxy.unlock()
              self._lock_count -= 1
      Severity: Minor
      Found in esky/__init__.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

      Avoid deeply nested control flow statements.
      Open

                              for (_, _, filenms) in os.walk(fullnm):
                                  if filenms:
                                      #  It contains unaccounted-for files in the
                                      #  bootstrap env. Can't prove it's safe to
                                      #  remove, so leave it alone.
      Severity: Major
      Found in esky/__init__.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if not os.path.exists(ovrdir):
                                    os.mkdir(ovrdir)
                                trn.move(bssrc, os.path.join(ovrdir, nm))
        Severity: Major
        Found in esky/__init__.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if self.active_version in exe:
                                      exe = exe.replace(self.active_version, version)
                                      if not os.path.isfile(exe):
                                          exe = sys.executable
                      if os.path.basename(exe).lower() in ("python", "pythonw"):
          Severity: Major
          Found in esky/__init__.py - About 45 mins to fix

            Avoid too many return statements within this function.
            Open

                        return True
            Severity: Major
            Found in esky/__init__.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return True
              Severity: Major
              Found in esky/__init__.py - About 30 mins to fix

                Function _get_versions_dir has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _get_versions_dir(self):
                        """Get the directory path containing individual version dirs."""
                        if not ESKY_APPDATA_DIR:
                            return self.appdir
                        # TODO: remove compatability hooks for ESKY_APPDATA_DIR=""
                Severity: Minor
                Found in esky/__init__.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 _version_manifest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _version_manifest(self, vdir):
                        """Get the bootstrap manifest for the given version directory.
                
                        This is the set of files/directories that the given version expects
                        to be in the main app directory.
                Severity: Minor
                Found in esky/__init__.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

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

                            if os.path.isdir(os.path.dirname(fullnm)):
                                if not os.listdir(os.path.dirname(fullnm)):
                                    trn.remove(os.path.dirname(fullnm))
                Severity: Major
                Found in esky/__init__.py and 1 other location - About 2 hrs to fix
                esky/__init__.py on lines 822..824

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

                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 os.path.isdir(os.path.dirname(bssrc)):
                                if not os.listdir(os.path.dirname(bssrc)):
                                    trn.remove(os.path.dirname(bssrc))
                Severity: Major
                Found in esky/__init__.py and 1 other location - About 2 hrs to fix
                esky/__init__.py on lines 917..919

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

                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 threading:
                                curthread = threading.currentThread()
                                try:
                                    threadid = curthread.ident
                                except AttributeError:
                Severity: Major
                Found in esky/__init__.py and 1 other location - About 1 hr to fix
                esky/__init__.py on lines 235..242

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

                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 threading:
                            curthread = threading.currentThread()
                            try:
                                threadid = curthread.ident
                            except AttributeError:
                Severity: Major
                Found in esky/__init__.py and 1 other location - About 1 hr to fix
                esky/__init__.py on lines 286..293

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

                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

                                vdir = os.sep.join(sys.executable[len(appdir):].split(os.sep)[1:3])
                Severity: Major
                Found in esky/__init__.py and 1 other location - About 1 hr to fix
                esky/__init__.py on lines 965..965

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

                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

                            vdir = os.sep.join(sys.executable[len(appdir):].split(os.sep)[1:3])
                Severity: Major
                Found in esky/__init__.py and 1 other location - About 1 hr to fix
                esky/__init__.py on lines 974..974

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

                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 best_version != new_version:
                                    (_, v, _) = split_app_version(new_version)
                                    yield (self.install_version, (v,))
                                    best_version = new_version
                Severity: Major
                Found in esky/__init__.py and 1 other location - About 1 hr to fix
                esky/__init__.py on lines 400..403

                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 best_version != new_version:
                            (_, v, _) = split_app_version(new_version)
                            yield (self.install_version, (v,))
                            best_version = new_version
                Severity: Major
                Found in esky/__init__.py and 1 other location - About 1 hr to fix
                esky/__init__.py on lines 410..413

                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

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

                            try:
                                self._unpack_bootstrap_env(target, trn)
                            except Exception:
                                trn.abort()
                                raise
                Severity: Minor
                Found in esky/__init__.py and 1 other location - About 35 mins to fix
                esky/__init__.py on lines 858..864

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

                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

                                try:
                                    self._cleanup_bootstrap_env(version, trn)
                                except Exception:
                                    trn.abort()
                                    raise
                Severity: Minor
                Found in esky/__init__.py and 1 other location - About 35 mins to fix
                esky/__init__.py on lines 786..792

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

                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 6 locations. Consider refactoring.
                Open

                    if len(sys.argv) > 1 and sys.argv[1] == "--esky-spawn-cleanup":
                Severity: Major
                Found in esky/__init__.py and 5 other locations - About 30 mins to fix
                esky/sudo/__init__.py on lines 92..92
                esky/sudo/sudo_osx.py on lines 216..216
                esky/sudo/sudo_unix.py on lines 169..169
                esky/sudo/sudo_win32.py on lines 327..327
                esky/slaveproc.py on lines 74..74

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

                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