christoph2/pyA2L

View on GitHub

Showing 171 of 238 total issues

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

                if definition.block_definition:
                    self.push_element(definition.block_definition)
                    block = self.block()
                    tag = block.pop("tag")
                    value = block.get("value")
Severity: Major
Found in pya2l/if_data_parser.py and 1 other location - About 1 day to fix
pya2l/if_data_parser.py on lines 320..331

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 definition.taggedstruct_definition.__class__.__name__ == "TaggedStructDefinition":
                        self.push_element(definition.taggedstruct_definition)
                        tsm = self.tagged_struct_member()
                        tag = tsm.pop("tag")
                        value = tsm.get("value")
Severity: Major
Found in pya2l/if_data_parser.py and 1 other location - About 1 day to fix
pya2l/if_data_parser.py on lines 304..315

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

    def exitTypedefCharacteristic(self, ctx):
        name = ctx.name.value
        longIdentifier = ctx.longIdentifier.value
        type_ = ctx.type_.text
        deposit = ctx.deposit_.value
Severity: Major
Found in pya2l/a2l_listener.py and 1 other location - About 1 day to fix
pya2l/a2l_listener.py on lines 1027..1046

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

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 exitTypedefMeasurement(self, ctx):
        name = ctx.name.value
        longIdentifier = ctx.longIdentifier.value
        datatype = ctx.datatype.value
        conversion = ctx.conversion.value
Severity: Major
Found in pya2l/a2l_listener.py and 1 other location - About 1 day to fix
pya2l/a2l_listener.py on lines 1006..1025

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

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 exitBitOperation(self, ctx):
        v_leftShift = delist(self.getList(ctx.v_leftShift), True)
        v_rightShift = delist(self.getList(ctx.v_rightShift), True)
        v_signExtend = delist(self.getList(ctx.v_signExtend), True)
        ctx.value = model.BitOperation(left_shift=v_leftShift, right_shift=v_rightShift, sign_extend=v_signExtend)
Severity: Major
Found in pya2l/a2l_listener.py and 1 other location - About 5 hrs to fix
pya2l/a2l_listener.py on lines 180..189

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 exitAnnotation(self, ctx):
        v_annotationLabel = delist(self.getList(ctx.v_annotationLabel), True)
        v_annotationOrigin = delist(self.getList(ctx.v_annotationOrigin), True)
        v_annotationText = delist(self.getList(ctx.v_annotationText), True)
        ctx.value = model.Annotation(
Severity: Major
Found in pya2l/a2l_listener.py and 1 other location - About 5 hrs to fix
pya2l/a2l_listener.py on lines 1087..1092

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

    def exitAxisRescaleX(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
        indexIncr = ctx.indexIncr.value
Severity: Major
Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
pya2l/a2l_listener.py on lines 1073..1080
pya2l/a2l_listener.py on lines 1564..1577
pya2l/a2l_listener.py on lines 1579..1592
pya2l/a2l_listener.py on lines 1594..1607
pya2l/a2l_listener.py on lines 1609..1622

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

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

    def exitStructureComponent(self, ctx):
        name = ctx.name.value
        deposit = ctx.deposit_.value
        offset = ctx.offset.value
        link = ctx.link.value
Severity: Major
Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
pya2l/a2l_listener.py on lines 1549..1562
pya2l/a2l_listener.py on lines 1564..1577
pya2l/a2l_listener.py on lines 1579..1592
pya2l/a2l_listener.py on lines 1594..1607
pya2l/a2l_listener.py on lines 1609..1622

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

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

    def exitAxisRescaleZ(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
        indexIncr = ctx.indexIncr.value
Severity: Major
Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
pya2l/a2l_listener.py on lines 1073..1080
pya2l/a2l_listener.py on lines 1549..1562
pya2l/a2l_listener.py on lines 1564..1577
pya2l/a2l_listener.py on lines 1594..1607
pya2l/a2l_listener.py on lines 1609..1622

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

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

    def exitAxisRescale5(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
        indexIncr = ctx.indexIncr.value
Severity: Major
Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
pya2l/a2l_listener.py on lines 1073..1080
pya2l/a2l_listener.py on lines 1549..1562
pya2l/a2l_listener.py on lines 1564..1577
pya2l/a2l_listener.py on lines 1579..1592
pya2l/a2l_listener.py on lines 1594..1607

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

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

    def exitAxisRescaleY(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
        indexIncr = ctx.indexIncr.value
Severity: Major
Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
pya2l/a2l_listener.py on lines 1073..1080
pya2l/a2l_listener.py on lines 1549..1562
pya2l/a2l_listener.py on lines 1579..1592
pya2l/a2l_listener.py on lines 1594..1607
pya2l/a2l_listener.py on lines 1609..1622

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

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

    def exitAxisRescale4(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        maxNumberOfRescalePairs = ctx.maxNumberOfRescalePairs.value
        indexIncr = ctx.indexIncr.value
Severity: Major
Found in pya2l/a2l_listener.py and 5 other locations - About 5 hrs to fix
pya2l/a2l_listener.py on lines 1073..1080
pya2l/a2l_listener.py on lines 1549..1562
pya2l/a2l_listener.py on lines 1564..1577
pya2l/a2l_listener.py on lines 1579..1592
pya2l/a2l_listener.py on lines 1609..1622

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

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 idx, tmem in enumerate(tree.members, 1):
                sm = model.AMLTaggedStructMember(
                    block_definition=self.block_definition(tmem.block_definition),
                    taggedstruct_definition=self.taggedstruct_definition(tmem.taggedstruct_definition),
                    multiple=tmem.multiple,
Severity: Major
Found in pya2l/aml/db.py and 1 other location - About 4 hrs to fix
pya2l/aml/db.py on lines 153..162

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

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 idx, mem in enumerate(tree.members, 1):
                tum = model.AMLTaggedUnionMember(
                    member=self.member(mem.member),
                    block_definition=self.block_definition(mem.block_definition),
                    tag=mem.tag,
Severity: Major
Found in pya2l/aml/db.py and 1 other location - About 4 hrs to fix
pya2l/aml/db.py on lines 133..142

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

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

    def exitAxisPtsZ(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        indexIncr = ctx.indexIncr.value
        addressing = ctx.addressing.value
Severity: Major
Found in pya2l/a2l_listener.py and 6 other locations - About 4 hrs to fix
pya2l/a2l_listener.py on lines 1048..1054
pya2l/a2l_listener.py on lines 1484..1495
pya2l/a2l_listener.py on lines 1497..1508
pya2l/a2l_listener.py on lines 1523..1534
pya2l/a2l_listener.py on lines 1536..1547
pya2l/a2l_listener.py on lines 1679..1690

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

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

    def exitAxisPtsX(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        indexIncr = ctx.indexIncr.value
        addressing = ctx.addressing.value
Severity: Major
Found in pya2l/a2l_listener.py and 6 other locations - About 4 hrs to fix
pya2l/a2l_listener.py on lines 1048..1054
pya2l/a2l_listener.py on lines 1497..1508
pya2l/a2l_listener.py on lines 1510..1521
pya2l/a2l_listener.py on lines 1523..1534
pya2l/a2l_listener.py on lines 1536..1547
pya2l/a2l_listener.py on lines 1679..1690

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

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

    def exitAxisPts4(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        indexIncr = ctx.indexIncr.value
        addressing = ctx.addressing.value
Severity: Major
Found in pya2l/a2l_listener.py and 6 other locations - About 4 hrs to fix
pya2l/a2l_listener.py on lines 1048..1054
pya2l/a2l_listener.py on lines 1484..1495
pya2l/a2l_listener.py on lines 1497..1508
pya2l/a2l_listener.py on lines 1510..1521
pya2l/a2l_listener.py on lines 1536..1547
pya2l/a2l_listener.py on lines 1679..1690

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

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

    def exitInstance(self, ctx):
        name = ctx.name.value
        longIdentifier = ctx.longIdentifier.value
        typeName = ctx.typeName.value
        address = ctx.address.value
Severity: Major
Found in pya2l/a2l_listener.py and 6 other locations - About 4 hrs to fix
pya2l/a2l_listener.py on lines 1484..1495
pya2l/a2l_listener.py on lines 1497..1508
pya2l/a2l_listener.py on lines 1510..1521
pya2l/a2l_listener.py on lines 1523..1534
pya2l/a2l_listener.py on lines 1536..1547
pya2l/a2l_listener.py on lines 1679..1690

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

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

    def exitAxisPtsY(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        indexIncr = ctx.indexIncr.value
        addressing = ctx.addressing.value
Severity: Major
Found in pya2l/a2l_listener.py and 6 other locations - About 4 hrs to fix
pya2l/a2l_listener.py on lines 1048..1054
pya2l/a2l_listener.py on lines 1484..1495
pya2l/a2l_listener.py on lines 1510..1521
pya2l/a2l_listener.py on lines 1523..1534
pya2l/a2l_listener.py on lines 1536..1547
pya2l/a2l_listener.py on lines 1679..1690

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

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

    def exitAxisPts5(self, ctx):
        position = ctx.position.value
        datatype = ctx.datatype.value
        indexIncr = ctx.indexIncr.value
        addressing = ctx.addressing.value
Severity: Major
Found in pya2l/a2l_listener.py and 6 other locations - About 4 hrs to fix
pya2l/a2l_listener.py on lines 1048..1054
pya2l/a2l_listener.py on lines 1484..1495
pya2l/a2l_listener.py on lines 1497..1508
pya2l/a2l_listener.py on lines 1510..1521
pya2l/a2l_listener.py on lines 1523..1534
pya2l/a2l_listener.py on lines 1679..1690

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

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