cloudmatrix/esky

View on GitHub

Showing 271 of 271 total issues

File patch.py has 1157 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.patch:  directory diffing and patching support for esky.
Severity: Major
Found in esky/patch.py - About 2 days to fix

    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

      File __init__.py has 708 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.bdist_esky:  distutils command to freeze apps in esky format
      Severity: Major
      Found in esky/bdist_esky/__init__.py - About 1 day to fix

        Function freeze has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
        Open

        def freeze(dist):
            """Freeze the given distribution data using py2app."""
            includes = dist.includes
            excludes = dist.excludes
            options = dist.freezer_options
        Severity: Minor
        Found in esky/bdist_esky/f_py2app.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 freeze has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
        Open

        def freeze(dist):
            """Freeze the given distribution data using py2exe."""
            includes = dist.includes
            excludes = dist.excludes
            options = dist.freezer_options
        Severity: Minor
        Found in esky/bdist_esky/f_py2exe.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 freeze has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
        Open

        def freeze(dist):
            """Freeze the given distribution data using bbfreeze."""
            includes = dist.includes
            excludes = dist.excludes
            options = dist.freezer_options
        Severity: Minor
        Found in esky/bdist_esky/f_bbfreeze.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 main has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
        Open

        def main(args):
            """Command-line diffing and patching for esky."""
            parser = optparse.OptionParser()
            parser.add_option("-z","--zipped",action="store_true",dest="zipped",
                              help="work with zipped source/target dirs")
        Severity: Minor
        Found in esky/patch.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 _prepare_version has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
        Open

            def _prepare_version(self,app,version,path):
                """Prepare the requested version from downloaded data.
        
                This method is responsible for unzipping downloaded versions, applying
                patches and so-forth, and making the result available as a local
        Severity: Minor
        Found in esky/finder.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 get_executables has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_executables(self,normalise=True):
                """Yield a normalised Executable instance for each script to be frozen.
        
                If "normalise" is True (the default) then the user-provided scripts
                will be rewritten to decode any non-filename items specified as part
        Severity: Minor
        Found in esky/bdist_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

        File bootstrap.py has 533 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.bootstrap:  minimal bootstrapping code for esky
        Severity: Major
        Found in esky/bootstrap.py - About 1 day to fix

          File finder.py has 528 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.finder:  VersionFinder implementations for esky
          Severity: Major
          Found in esky/finder.py - About 1 day to fix

            Function freeze has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
            Open

            def freeze(dist):
                """Freeze the given distribution data using cx_Freeze."""
                includes = dist.includes
                excludes = dist.excludes
                options = dist.freezer_options
            Severity: Minor
            Found in esky/bdist_esky/f_cxfreeze.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_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

            File util.py has 490 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.util:  misc utility functions for esky
            Severity: Minor
            Found in esky/util.py - About 7 hrs to fix

              Function _find_msvcrt_manifest_files has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _find_msvcrt_manifest_files(name):
                      """Search the system for candidate MSVCRT manifest files.
              
                      This method yields (manifest_file,msvcrt_dir) tuples giving a candidate
                      manifest file for the given assembly name, and the directory in which
              Severity: Minor
              Found in esky/bdist_esky/__init__.py - About 7 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 _diff_dir has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _diff_dir(self,source,target):
                      """Generate patch commands for when the target is a directory."""
                      #  If it's not already a directoy, make it one.
                      if not os.path.isdir(source):
                          self._write_command(MAKEDIR)
              Severity: Minor
              Found in esky/patch.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

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

                  def String_FromString(self,s):
                      impl = self.lib.getpointer("PyString_FromString",[clibffi.ffi_type_pointer],clibffi.ffi_type_pointer)
                      buf = rffi.str2charp(s)
                      impl.push_arg(rffi.cast(rffi.VOIDP,buf))
                      ps = impl.call(rffi.VOIDP)
              Severity: Major
              Found in esky/bdist_esky/pypy_libpython.py and 1 other location - About 5 hrs to fix
              esky/bdist_esky/pypy_libpython.py on lines 158..166

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

              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

                  def Import_ImportModule(self,name):
                      impl = self.lib.getpointer("PyImport_ImportModule",[clibffi.ffi_type_pointer],clibffi.ffi_type_pointer)
                      buf = rffi.str2charp(name)
                      impl.push_arg(rffi.cast(rffi.VOIDP,buf))
                      mod = impl.call(rffi.VOIDP)
              Severity: Major
              Found in esky/bdist_esky/pypy_libpython.py and 1 other location - About 5 hrs to fix
              esky/bdist_esky/pypy_libpython.py on lines 272..280

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

              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(target):
                              s_names = os.listdir(source)
                              for nm in s_names:
                                  self.move(os.path.join(source,nm),
                                            os.path.join(target,nm))
              Severity: Major
              Found in esky/fstransact/win32txf.py and 1 other location - About 5 hrs to fix
              esky/fstransact/fallback.py on lines 48..56

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

              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

                      for i in xrange(0,len(bcontrol),24):
                          tcontrol.append((
                              _decode_offt(bcontrol[i:i+8]),
                              _decode_offt(bcontrol[i+8:i+16]),
                              _decode_offt(bcontrol[i+16:i+24]),
              Severity: Major
              Found in esky/patch.py and 1 other location - About 5 hrs to fix
              esky/patch.py on lines 148..152

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

              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

              Severity
              Category
              Status
              Source
              Language