django/django

View on GitHub
django/contrib/gis/gdal/prototypes/generation.py

Summary

Maintainability
C
1 day
Test Coverage

Function double_output has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def double_output(func, argtypes, errcheck=False, strarg=False, cpl=False):
Severity: Minor
Found in django/contrib/gis/gdal/prototypes/generation.py - About 35 mins to fix

    Function string_output has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def string_output(func, argtypes, offset=-1, str_result=False, decoding=None):
    Severity: Minor
    Found in django/contrib/gis/gdal/prototypes/generation.py - About 35 mins to fix

      Function const_string_output has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def const_string_output(func, argtypes, offset=None, decoding=None, cpl=False):
      Severity: Minor
      Found in django/contrib/gis/gdal/prototypes/generation.py - About 35 mins to fix

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

            def _check_str(result, func, cargs):
                res = check_string(result, func, cargs, offset=offset, str_result=str_result)
                if res and decoding:
                    res = res.decode(decoding)
                return res
        Severity: Major
        Found in django/contrib/gis/gdal/prototypes/generation.py and 1 other location - About 1 hr to fix
        django/contrib/gis/gdal/prototypes/generation.py on lines 105..109

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

        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 _check_const(result, func, cargs):
                res = check_const_string(result, func, cargs, offset=offset, cpl=cpl)
                if res and decoding:
                    res = res.decode(decoding)
                return res
        Severity: Major
        Found in django/contrib/gis/gdal/prototypes/generation.py and 1 other location - About 1 hr to fix
        django/contrib/gis/gdal/prototypes/generation.py on lines 135..139

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

        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 int_output(func, argtypes, errcheck=None):
            "Generate a ctypes function that returns an integer value."
            func.argtypes = argtypes
            func.restype = c_int
            if errcheck:
        Severity: Major
        Found in django/contrib/gis/gdal/prototypes/generation.py and 2 other locations - About 1 hr to fix
        django/contrib/gis/gdal/prototypes/generation.py on lines 26..32
        django/contrib/gis/gdal/prototypes/generation.py on lines 163..169

        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

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

        def voidptr_output(func, argtypes, errcheck=True):
            "For functions that return c_void_p."
            func.argtypes = argtypes
            func.restype = c_void_p
            if errcheck:
        Severity: Major
        Found in django/contrib/gis/gdal/prototypes/generation.py and 2 other locations - About 1 hr to fix
        django/contrib/gis/gdal/prototypes/generation.py on lines 26..32
        django/contrib/gis/gdal/prototypes/generation.py on lines 70..76

        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

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

        def bool_output(func, argtypes, errcheck=None):
            """Generate a ctypes function that returns a boolean value."""
            func.argtypes = argtypes
            func.restype = c_bool
            if errcheck:
        Severity: Major
        Found in django/contrib/gis/gdal/prototypes/generation.py and 2 other locations - About 1 hr to fix
        django/contrib/gis/gdal/prototypes/generation.py on lines 70..76
        django/contrib/gis/gdal/prototypes/generation.py on lines 163..169

        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

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

        def srs_output(func, argtypes):
            """
            Generate a ctypes prototype for the given function with
            the given C arguments that returns a pointer to an OGR
            Spatial Reference System.
        Severity: Minor
        Found in django/contrib/gis/gdal/prototypes/generation.py and 1 other location - About 40 mins to fix
        django/contrib/gis/gdal/prototypes/geom.py on lines 19..24

        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