code4game/libgltf

View on GitHub

Showing 92 of 92 total issues

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

Severity: Major
Found in tools/jsonschematoc11/__init__.py and 1 other location - About 4 hrs to fix
tools/jsonschematoc11/__main__.py on lines 0..13

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

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 self.manualCodeSourcesFunction is not None and len(self.manualCodeSourcesFunction) > 0:
            codeLines.append(u'')
            codeLines.append(u'// Manual code lines')
            for code_source_function_line in self.manualCodeSourcesFunction:
                codeLines.append(u'%s' % code_source_function_line.replace(u'\n', u''))
Severity: Major
Found in tools/jsonschematoc11/c11types/c11typestruct.py and 1 other location - About 4 hrs to fix
tools/jsonschematoc11/c11types/c11typestruct.py on lines 162..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 77.

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 self.manualCodeHeaders is not None and len(self.manualCodeHeaders) > 0:
            codeLines.append(u'')
            codeLines.append(u'    // Manual code lines')
            for code_header_line in self.manualCodeHeaders:
                codeLines.append(u'    %s' % code_header_line.replace(u'\n', u''))
Severity: Major
Found in tools/jsonschematoc11/c11types/c11typestruct.py and 1 other location - About 4 hrs to fix
tools/jsonschematoc11/c11types/c11typestruct.py on lines 230..234

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

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

File c11typestruct.py has 307 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from .c11type import C11Type
from .c11typebool import C11TypeBool
from .c11typeinteger import C11TypeInteger
from .c11typenumber import C11TypeNumber
from .c11typestring import C11TypeString
Severity: Minor
Found in tools/jsonschematoc11/c11types/c11typestruct.py - About 3 hrs to fix

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

            for key in self.parents:
                parent = self.parents[key]
                if parent.codeTypeName() in codeTypeNames:
                    continue
                for parentCodeLine in parent.codeSource(codeTypeNames):
    Severity: Major
    Found in tools/jsonschematoc11/c11types/c11typestruct.py and 1 other location - About 3 hrs to fix
    tools/jsonschematoc11/c11types/c11typestruct.py on lines 128..134

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

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

                if config is not None and config.has_option(u'code.headers', schemaFileName):
                    code_file_path = config.get(u'code.headers', schemaFileName)
                    if os.path.isfile(code_file_path):
                        with open(code_file_path, u'r') as code_file:
                            code_headers = code_file.readlines()
    Severity: Major
    Found in tools/jsonschematoc11/jsonschematoc11.py and 4 other locations - About 3 hrs to fix
    tools/jsonschematoc11/jsonschematoc11.py on lines 43..47
    tools/jsonschematoc11/jsonschematoc11.py on lines 49..53
    tools/jsonschematoc11/jsonschematoc11.py on lines 55..59
    tools/jsonschematoc11/jsonschematoc11.py on lines 61..65

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

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

                if config is not None and config.has_option(u'code.sources.function', schemaFileName):
                    code_file_path = config.get(u'code.sources.function', schemaFileName)
                    if os.path.isfile(code_file_path):
                        with open(code_file_path, u'r') as code_file:
                            code_sources_function = code_file.readlines()
    Severity: Major
    Found in tools/jsonschematoc11/jsonschematoc11.py and 4 other locations - About 3 hrs to fix
    tools/jsonschematoc11/jsonschematoc11.py on lines 37..41
    tools/jsonschematoc11/jsonschematoc11.py on lines 43..47
    tools/jsonschematoc11/jsonschematoc11.py on lines 55..59
    tools/jsonschematoc11/jsonschematoc11.py on lines 61..65

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

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

                if config is not None and config.has_option(u'code.parsers.to', schemaFileName):
                    code_file_path = config.get(u'code.parsers.to', schemaFileName)
                    if os.path.isfile(code_file_path):
                        with open(code_file_path, u'r') as code_file:
                            code_parsers_to = code_file.readlines()
    Severity: Major
    Found in tools/jsonschematoc11/jsonschematoc11.py and 4 other locations - About 3 hrs to fix
    tools/jsonschematoc11/jsonschematoc11.py on lines 37..41
    tools/jsonschematoc11/jsonschematoc11.py on lines 43..47
    tools/jsonschematoc11/jsonschematoc11.py on lines 49..53
    tools/jsonschematoc11/jsonschematoc11.py on lines 55..59

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

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

                if config is not None and config.has_option(u'code.parsers.from', schemaFileName):
                    code_file_path = config.get(u'code.parsers.from', schemaFileName)
                    if os.path.isfile(code_file_path):
                        with open(code_file_path, u'r') as code_file:
                            code_parsers_from = code_file.readlines()
    Severity: Major
    Found in tools/jsonschematoc11/jsonschematoc11.py and 4 other locations - About 3 hrs to fix
    tools/jsonschematoc11/jsonschematoc11.py on lines 37..41
    tools/jsonschematoc11/jsonschematoc11.py on lines 43..47
    tools/jsonschematoc11/jsonschematoc11.py on lines 49..53
    tools/jsonschematoc11/jsonschematoc11.py on lines 61..65

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

    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

            for key in self.parents:
                parent = self.parents[key]
                if parent.codeTypeName() in codeTypeNames:
                    continue
                for parentCodeLine in parent.codeHeader(codeTypeNames):
    Severity: Major
    Found in tools/jsonschematoc11/c11types/c11typestruct.py and 1 other location - About 3 hrs to fix
    tools/jsonschematoc11/c11types/c11typestruct.py on lines 175..181

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

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

                if config is not None and config.has_option(u'code.sources.variable', schemaFileName):
                    code_file_path = config.get(u'code.sources.variable', schemaFileName)
                    if os.path.isfile(code_file_path):
                        with open(code_file_path, u'r') as code_file:
                            code_sources_variable = code_file.readlines()
    Severity: Major
    Found in tools/jsonschematoc11/jsonschematoc11.py and 4 other locations - About 3 hrs to fix
    tools/jsonschematoc11/jsonschematoc11.py on lines 37..41
    tools/jsonschematoc11/jsonschematoc11.py on lines 49..53
    tools/jsonschematoc11/jsonschematoc11.py on lines 55..59
    tools/jsonschematoc11/jsonschematoc11.py on lines 61..65

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

    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

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

        def setSchema(self, schemaName, schemaValue):
            C11Type.setSchema(self, schemaName, schemaValue)
            if u'type' in schemaValue:
                schemaValueType = schemaValue[u'type']
                if schemaValueType == u'bool' or schemaValueType == u'boolean':
    Severity: Minor
    Found in tools/jsonschematoc11/c11types/c11typestruct.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

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

            if u'items' in schemaValue:
                (c11_type, error_code, error_message) = self.buildC11Type(schemaValue[u'items'])
            elif u'$ref' in schemaValue:
                (c11_type, error_code, error_message) = self.buildC11Type(schemaValue[u'$ref'])
    Severity: Major
    Found in tools/jsonschematoc11/c11types/c11typearray.py and 1 other location - About 3 hrs to fix
    tools/jsonschematoc11/c11types/c11typemap.py on lines 40..43

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

    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 u'items' in schemaValue:
                (c11Type, _, _) = self.buildC11Type(schemaValue[u'items'])
            elif u'$ref' in schemaValue:
                (c11Type, _, _) = self.buildC11Type(schemaValue[u'$ref'])
    Severity: Major
    Found in tools/jsonschematoc11/c11types/c11typemap.py and 1 other location - About 3 hrs to fix
    tools/jsonschematoc11/c11types/c11typearray.py on lines 57..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 63.

    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

    Function addSchema has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        def addSchema(self, rootPath, schemaFileName, config=None):
            schema_file_path = os.path.join(rootPath, schemaFileName)
            with open(schema_file_path, u'r') as schema_file:
                schema = json.load(schema_file)
                if schema is None:
    Severity: Minor
    Found in tools/jsonschematoc11/jsonschematoc11.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 codeHeader has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def codeHeader(self, codeTypeNames):
            codeLines = []
            if self.codeTypeName() in codeTypeNames:
                return codeLines
            for key in self.parents:
    Severity: Minor
    Found in tools/jsonschematoc11/c11types/c11typestruct.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 buildC11Type has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def buildC11Type(self, schemaValue):
            c11Type = None
            schemaValueType = None
            variableSchemaValue = schemaValue
            if u'type' in schemaValue:
    Severity: Minor
    Found in tools/jsonschematoc11/c11types/c11typearray.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 revise has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def revise(self, c11Types):
            from .c11typestruct import C11TypeStruct
            from .c11typemap import C11TypeMap
            if not isinstance(self.c11Type, C11TypeStruct) and not isinstance(self.c11Type, C11TypeMap):
                return (0, None)
    Severity: Minor
    Found in tools/jsonschematoc11/c11types/c11typearray.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 codeParser has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        def codeParser(self, isSet=True):
            codeLines = []
            codeCheckLine = self.c11Type.codeJsonCheck()
            if isSet:
                if codeCheckLine is None or len(codeCheckLine) <= 0:
    Severity: Minor
    Found in tools/jsonschematoc11/c11types/c11variable.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

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

            for schema_value in schemaDefaultValues:
                if len(code_default_value) > 0:
                    code_default_value = code_default_value + u', '
                code_default_value = code_default_value + u'%ff' % schema_value
    Severity: Major
    Found in tools/jsonschematoc11/c11types/c11typenumber.py and 2 other locations - About 1 hr to fix
    tools/jsonschematoc11/c11types/c11typeinteger.py on lines 22..25
    tools/jsonschematoc11/c11types/c11typestring.py on lines 26..29

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

    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