code4game/libgltf

View on GitHub

Showing 52 of 92 total issues

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

            for key in self.c11Types:
                c11_type = self.c11Types[key]
                if c11_type.codeTypeName() in parent_type_names:
                    continue

Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 1 other location - About 1 day to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 284..299

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

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.c11Types:
                c11_type = self.c11Types[key]
                if c11_type.codeTypeName() in parent_type_names:
                    continue

Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 1 other location - About 1 day to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 217..232

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

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 config is not None and config.has_option(u'code', u'license'):
                code_file_path = config.get(u'code', u'license')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        header_file.write(u'/*\n')
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 1 other location - About 7 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 372..381

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

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 config is not None and config.has_option(u'code', u'license'):
                code_file_path = config.get(u'code', u'license')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        source_file.write(u'/*\n')
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 1 other location - About 7 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 142..151

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

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 config is not None and config.has_option(u'code', u'license'):
                code_file_path = config.get(u'code', u'license')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        code_file_lines = code_file.readlines()
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 1 other location - About 7 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 311..320

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

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 config is not None and config.has_option(u'code', u'license'):
                code_file_path = config.get(u'code', u'license')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        code_file_lines = code_file.readlines()
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 1 other location - About 7 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 256..265

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

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.c11Types:
                c11_type = self.c11Types[key]
                if not isinstance(c11_type, C11TypeStruct):
                    continue

Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 1 other location - About 5 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 355..366

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

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

            for key in self.c11Types:
                c11_type = self.c11Types[key]
                if not isinstance(c11_type, C11TypeStruct):
                    continue

Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 1 other location - About 5 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 549..560

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

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

            if config is not None and config.has_option(u'code.headers', u'header.begin'):
                code_file_path = config.get(u'code.headers', u'header.begin')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        code_header_extra_lines = code_file.readlines()
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 5 other locations - About 5 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 162..169
tools/jsonschematoc11/jsonschematoc11.py on lines 192..199
tools/jsonschematoc11/jsonschematoc11.py on lines 234..241
tools/jsonschematoc11/jsonschematoc11.py on lines 246..253
tools/jsonschematoc11/jsonschematoc11.py on lines 325..332

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

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 config is not None and config.has_option(u'code.headers', u'header.end'):
                code_file_path = config.get(u'code.headers', u'header.end')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        code_header_extra_lines = code_file.readlines()
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 5 other locations - About 5 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 153..160
tools/jsonschematoc11/jsonschematoc11.py on lines 162..169
tools/jsonschematoc11/jsonschematoc11.py on lines 192..199
tools/jsonschematoc11/jsonschematoc11.py on lines 234..241
tools/jsonschematoc11/jsonschematoc11.py on lines 325..332

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

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 config is not None and config.has_option(u'code.parser', u'header'):
                code_file_path = config.get(u'code.parser', u'header')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        code_header_extra_lines = code_file.readlines()
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 5 other locations - About 5 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 153..160
tools/jsonschematoc11/jsonschematoc11.py on lines 162..169
tools/jsonschematoc11/jsonschematoc11.py on lines 192..199
tools/jsonschematoc11/jsonschematoc11.py on lines 234..241
tools/jsonschematoc11/jsonschematoc11.py on lines 246..253

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

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 config is not None and config.has_option(u'code.headers', u'header.include'):
                code_file_path = config.get(u'code.headers', u'header.include')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        code_header_extra_lines = code_file.readlines()
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 5 other locations - About 5 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 153..160
tools/jsonschematoc11/jsonschematoc11.py on lines 192..199
tools/jsonschematoc11/jsonschematoc11.py on lines 234..241
tools/jsonschematoc11/jsonschematoc11.py on lines 246..253
tools/jsonschematoc11/jsonschematoc11.py on lines 325..332

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

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 config is not None and config.has_option(u'code.headers', u'header.namespace.end'):
                code_file_path = config.get(u'code.headers', u'header.namespace.end')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        code_header_extra_lines = code_file.readlines()
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 5 other locations - About 5 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 153..160
tools/jsonschematoc11/jsonschematoc11.py on lines 162..169
tools/jsonschematoc11/jsonschematoc11.py on lines 192..199
tools/jsonschematoc11/jsonschematoc11.py on lines 246..253
tools/jsonschematoc11/jsonschematoc11.py on lines 325..332

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

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 config is not None and config.has_option(u'code.headers', u'header.namespace.begin'):
                code_file_path = config.get(u'code.headers', u'header.namespace.begin')
                if os.path.isfile(code_file_path):
                    with open(code_file_path, u'r') as code_file:
                        code_header_extra_lines = code_file.readlines()
Severity: Major
Found in tools/jsonschematoc11/jsonschematoc11.py and 5 other locations - About 5 hrs to fix
tools/jsonschematoc11/jsonschematoc11.py on lines 153..160
tools/jsonschematoc11/jsonschematoc11.py on lines 162..169
tools/jsonschematoc11/jsonschematoc11.py on lines 234..241
tools/jsonschematoc11/jsonschematoc11.py on lines 246..253
tools/jsonschematoc11/jsonschematoc11.py on lines 325..332

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

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

Severity: Major
Found in tools/jsonschematoc11/__main__.py and 1 other location - About 4 hrs to fix
tools/jsonschematoc11/__init__.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

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

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

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

Severity
Category
Status
Source
Language