cloudmatrix/esky

View on GitHub
esky/bdist_esky/pypy_libpython.py

Summary

Maintainability
F
6 days
Test Coverage

libpython has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

class libpython(object):

    file_input = 257


Severity: Minor
Found in esky/bdist_esky/pypy_libpython.py - About 3 hrs to fix

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

        def Set_OptimizeFlag(self,value):
            addr = self.lib.getaddressindll("Py_OptimizeFlag")
            memset = self._libc.getpointer("memset",[clibffi.ffi_type_pointer,clibffi.ffi_type_uint,clibffi.ffi_type_uint],clibffi.ffi_type_void)
            memset.push_arg(addr)
            memset.push_arg(value)
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 3 other locations - About 4 hrs to fix
    esky/bdist_esky/pypy_libpython.py on lines 27..33
    esky/bdist_esky/pypy_libpython.py on lines 36..42
    esky/bdist_esky/pypy_libpython.py on lines 45..51

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

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

        def Set_FrozenFlag(self,value):
            addr = self.lib.getaddressindll("Py_FrozenFlag")
            memset = self._libc.getpointer("memset",[clibffi.ffi_type_pointer,clibffi.ffi_type_uint,clibffi.ffi_type_uint],clibffi.ffi_type_void)
            memset.push_arg(addr)
            memset.push_arg(value)
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 3 other locations - About 4 hrs to fix
    esky/bdist_esky/pypy_libpython.py on lines 27..33
    esky/bdist_esky/pypy_libpython.py on lines 45..51
    esky/bdist_esky/pypy_libpython.py on lines 54..60

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

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

        def Set_NoSiteFlag(self,value):
            addr = self.lib.getaddressindll("Py_NoSiteFlag")
            memset = self._libc.getpointer("memset",[clibffi.ffi_type_pointer,clibffi.ffi_type_uint,clibffi.ffi_type_uint],clibffi.ffi_type_void)
            memset.push_arg(addr)
            memset.push_arg(value)
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 3 other locations - About 4 hrs to fix
    esky/bdist_esky/pypy_libpython.py on lines 36..42
    esky/bdist_esky/pypy_libpython.py on lines 45..51
    esky/bdist_esky/pypy_libpython.py on lines 54..60

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

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

        def Set_IgnoreEnvironmentFlag(self,value):
            addr = self.lib.getaddressindll("Py_IgnoreEnvironmentFlag")
            memset = self._libc.getpointer("memset",[clibffi.ffi_type_pointer,clibffi.ffi_type_uint,clibffi.ffi_type_uint],clibffi.ffi_type_void)
            memset.push_arg(addr)
            memset.push_arg(value)
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 3 other locations - About 4 hrs to fix
    esky/bdist_esky/pypy_libpython.py on lines 27..33
    esky/bdist_esky/pypy_libpython.py on lines 36..42
    esky/bdist_esky/pypy_libpython.py on lines 54..60

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

    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 String_AsString(self,s):
            impl = self.lib.getpointer("PyString_AsString",[clibffi.ffi_type_pointer],clibffi.ffi_type_pointer)
            impl.push_arg(s)
            buf = impl.call(rffi.VOIDP)
            if not buf:
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 1 other location - About 3 hrs to fix
    esky/bdist_esky/pypy_libpython.py on lines 235..241

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

    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 List_New(self,size=0):
            impl = self.lib.getpointer("PyList_New",[clibffi.ffi_type_uint],clibffi.ffi_type_pointer)
            impl.push_arg(size)
            l = impl.call(rffi.VOIDP)
            if not l:
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 1 other location - About 3 hrs to fix
    esky/bdist_esky/pypy_libpython.py on lines 300..306

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

    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 Eval_GetBuiltins(self):
            impl = self.lib.getpointer("PyEval_GetBuiltins",[],clibffi.ffi_type_pointer)
            d = impl.call(rffi.VOIDP)
            if not d:
                self._error()
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 1 other location - About 2 hrs to fix
    esky/bdist_esky/pypy_libpython.py on lines 215..220

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

    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 Dict_New(self):
            impl = self.lib.getpointer("PyDict_New",[],clibffi.ffi_type_pointer)
            d = impl.call(rffi.VOIDP)
            if not d:
                self._error()
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 1 other location - About 2 hrs to fix
    esky/bdist_esky/pypy_libpython.py on lines 150..155

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

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

        def Finalize(self):
            impl = self.lib.getpointer("Py_Finalize",[],clibffi.ffi_type_void)
            impl.call(lltype.Void)
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 2 other locations - About 40 mins to fix
    esky/bdist_esky/pypy_libpython.py on lines 63..65
    esky/bdist_esky/pypy_libpython.py on lines 78..80

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

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

        def Err_Print(self):
            impl = self.lib.getpointer("PyErr_Print",[],clibffi.ffi_type_void)
            impl.call(lltype.Void)
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 2 other locations - About 40 mins to fix
    esky/bdist_esky/pypy_libpython.py on lines 63..65
    esky/bdist_esky/pypy_libpython.py on lines 68..70

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

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

        def Initialize(self):
            impl = self.lib.getpointer("Py_Initialize",[],clibffi.ffi_type_void)
            impl.call(lltype.Void)
    Severity: Major
    Found in esky/bdist_esky/pypy_libpython.py and 2 other locations - About 40 mins to fix
    esky/bdist_esky/pypy_libpython.py on lines 68..70
    esky/bdist_esky/pypy_libpython.py on lines 78..80

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

    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