christoph2/pydbc

View on GitHub

Showing 197 of 197 total issues

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

    def exitEvent_triggered_frame_item(self, ctx):
        e = self.getValue(ctx.e)
        c = self.getValue(ctx.c)
        fid = self.getValue(ctx.fid)
        items = [x.value for x in ctx.items]
Severity: Major
Found in pydbc/ldfListener.py and 1 other location - About 4 hrs to fix
pydbc/dbcListener.py on lines 884..889

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def exitSignalGroup(self, ctx):
        messageID = self.getValue(ctx.messageID)
        groupName = self.getValue(ctx.groupName)
        gvalue = self.getValue(ctx.gvalue)
        signals = [x.value for x in ctx.signals]
Severity: Major
Found in pydbc/dbcListener.py and 1 other location - About 4 hrs to fix
pydbc/ldfListener.py on lines 513..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 85.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Cyclomatic complexity is too high in method exitSchedule_table_def. (21)
Open

    def exitSchedule_table_def(self, ctx):
        self.log_insertion("ScheduleTables")
        ctx.value = [x.value for x in ctx.items]
        for table in ctx.value:
            name = table['name']
Severity: Minor
Found in pydbc/ldfListener.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

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

            for frameName in sf['frameNames']:
                frame = self.MESSAGE_BY_NAME(self.session).params(name = frameName).first()
                if not frame:
                    self.logger.error("While inserting sporadic frames: frame '{}' does not exist.".format(frameName))
                    continue
Severity: Major
Found in pydbc/ldfListener.py and 1 other location - About 4 hrs to fix
pydbc/ldfListener.py on lines 505..510

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

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 frameName in ef['frameNames']:
                frame = self.MESSAGE_BY_NAME(self.session).params(name = frameName).first()
                if not frame:
                    self.logger.error("While inserting event triggered frames: frame '{}' does not exist.".format(frameName))
                    continue
Severity: Major
Found in pydbc/ldfListener.py and 1 other location - About 4 hrs to fix
pydbc/ldfListener.py on lines 482..487

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

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

class LinScheduleTable_Command_SlaveResp(LinScheduleTable_Command):
    """
    """
    command_id = Column(
        types.Integer,
Severity: Major
Found in pydbc/db/model.py and 1 other location - About 3 hrs to fix
pydbc/db/model.py on lines 1089..1109

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

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

class LinScheduleTable_Command_MasterReq(LinScheduleTable_Command):
    """
    """
    command_id = Column(
        types.Integer,
Severity: Major
Found in pydbc/db/model.py and 1 other location - About 3 hrs to fix
pydbc/db/model.py on lines 1112..1131

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

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

class EnvVar_AccessNode(Base, MixInBase):

    envvar_id = Column(types.Integer,
        ForeignKey("envvar.rid", onupdate = "CASCADE", ondelete = "RESTRICT"),
        nullable = False, default = 0, primary_key = True
Severity: Major
Found in pydbc/db/model.py and 6 other locations - About 3 hrs to fix
pydbc/db/model.py on lines 188..195
pydbc/db/model.py on lines 337..344
pydbc/db/model.py on lines 349..355
pydbc/db/model.py on lines 392..399
pydbc/db/model.py on lines 470..478
pydbc/db/model.py on lines 483..491

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

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

class Node_RxSig(Base, MixInBase):

    node = Column(types.Integer,
        ForeignKey("node.rid", onupdate = "CASCADE", ondelete = "RESTRICT"),
        nullable = False, default = 0, primary_key = True
Severity: Major
Found in pydbc/db/model.py and 6 other locations - About 3 hrs to fix
pydbc/db/model.py on lines 337..344
pydbc/db/model.py on lines 349..355
pydbc/db/model.py on lines 392..399
pydbc/db/model.py on lines 470..478
pydbc/db/model.py on lines 483..491
pydbc/db/model.py on lines 540..547

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

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

class Vehicle_ECU(Base, MixInBase):

    vehicle = Column(types.Integer,
        ForeignKey("vehicle.rid", onupdate = "CASCADE", ondelete = "RESTRICT"),
        nullable = False, default = 0, primary_key = True
Severity: Major
Found in pydbc/db/model.py and 6 other locations - About 3 hrs to fix
pydbc/db/model.py on lines 188..195
pydbc/db/model.py on lines 337..344
pydbc/db/model.py on lines 349..355
pydbc/db/model.py on lines 392..399
pydbc/db/model.py on lines 483..491
pydbc/db/model.py on lines 540..547

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

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

class Vehicle_Network(Base, MixInBase):

    vehicle = Column(types.Integer,
        ForeignKey("vehicle.rid", onupdate = "CASCADE", ondelete = "RESTRICT"),
        nullable = False, default = 0, primary_key = True
Severity: Major
Found in pydbc/db/model.py and 6 other locations - About 3 hrs to fix
pydbc/db/model.py on lines 188..195
pydbc/db/model.py on lines 337..344
pydbc/db/model.py on lines 349..355
pydbc/db/model.py on lines 392..399
pydbc/db/model.py on lines 470..478
pydbc/db/model.py on lines 540..547

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

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

class ECU_EnvVar(Base, MixInBase):

    ecu = Column(types.Integer,
        ForeignKey("ecu.rid", onupdate = "CASCADE", ondelete = "RESTRICT"),
        nullable = False, default = 0, primary_key = True,
Severity: Major
Found in pydbc/db/model.py and 6 other locations - About 3 hrs to fix
pydbc/db/model.py on lines 188..195
pydbc/db/model.py on lines 349..355
pydbc/db/model.py on lines 392..399
pydbc/db/model.py on lines 470..478
pydbc/db/model.py on lines 483..491
pydbc/db/model.py on lines 540..547

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

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

class ECU_Node(Base, MixInBase):
    ecu = Column(types.Integer,
        ForeignKey("ecu.rid", onupdate = "CASCADE", ondelete = "RESTRICT"),
        nullable = False, default = 0, primary_key = True,
    )
Severity: Major
Found in pydbc/db/model.py and 6 other locations - About 3 hrs to fix
pydbc/db/model.py on lines 188..195
pydbc/db/model.py on lines 337..344
pydbc/db/model.py on lines 392..399
pydbc/db/model.py on lines 470..478
pydbc/db/model.py on lines 483..491
pydbc/db/model.py on lines 540..547

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

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

class Network_Node(Base, MixInBase):

    network = Column(types.Integer,
        ForeignKey("network.rid", onupdate = "CASCADE", ondelete = "RESTRICT"),
        nullable = False, default = 0, primary_key = True
Severity: Major
Found in pydbc/db/model.py and 6 other locations - About 3 hrs to fix
pydbc/db/model.py on lines 188..195
pydbc/db/model.py on lines 337..344
pydbc/db/model.py on lines 349..355
pydbc/db/model.py on lines 470..478
pydbc/db/model.py on lines 483..491
pydbc/db/model.py on lines 540..547

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            elif attrType == AttributeType.ENV_VAR:
                key = attr['envVarname']
                envvar = self.ENVVAR_BY_NAME(self.session).params(name = key).first()
                if not envvar:
                    self.logger.error("While inserting attribute values: environment variable '{}' does not exist.".format(key))
Severity: Major
Found in pydbc/dbcListener.py and 3 other locations - About 3 hrs to fix
pydbc/dbcListener.py on lines 714..720
pydbc/dbcListener.py on lines 724..730
pydbc/dbcListener.py on lines 812..818

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            elif attrributeType == AttributeType.REL_ENV_VAR:
                evName = parent['evName']
                env_var = self.ENVVAR_BY_NAME(self.session).params(name = evName).first()
                if not env_var:
                    self.logger.error("While inserting relative attribute values: environment variable '{}' does not exist.".format(evName))
Severity: Major
Found in pydbc/dbcListener.py and 3 other locations - About 3 hrs to fix
pydbc/dbcListener.py on lines 714..720
pydbc/dbcListener.py on lines 724..730
pydbc/dbcListener.py on lines 731..737

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            elif attrType == AttributeType.NODE:
                key = attr['nodeName']
                node = self.NODE_BY_NAME(self.session).params(name = key).first()
                if not node:
                    self.logger.error("While inserting attribute values: node '{}' does not exist.".format(key))
Severity: Major
Found in pydbc/dbcListener.py and 3 other locations - About 3 hrs to fix
pydbc/dbcListener.py on lines 714..720
pydbc/dbcListener.py on lines 731..737
pydbc/dbcListener.py on lines 812..818

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            if attrType == AttributeType.MESSAGE:
                key = attr['messageID']
                msg = self.MESSAGE_BY_MESSAGE_ID(self.session).params(message_id = key).first()
                if not msg:
                    self.logger.error("While inserting attribute values: message '{}' does not exist.".format(key))
Severity: Major
Found in pydbc/dbcListener.py and 3 other locations - About 3 hrs to fix
pydbc/dbcListener.py on lines 724..730
pydbc/dbcListener.py on lines 731..737
pydbc/dbcListener.py on lines 812..818

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

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

Cyclomatic complexity is too high in method insertAttributeDefinitions. (17)
Open

    def insertAttributeDefinitions(self, ctx):
        self.log_insertion("AttributeDefinitions")
        ctx.value = [x.value for x in ctx.items]
        for attr in ctx.value:
            attrType = attr['type']
Severity: Minor
Found in pydbc/dbcListener.py by radon

Cyclomatic Complexity

Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

Construct Effect on CC Reasoning
if +1 An if statement is a single decision.
elif +1 The elif statement adds another decision.
else +0 The else statement does not cause a new decision. The decision is at the if.
for +1 There is a decision at the start of the loop.
while +1 There is a decision at the while statement.
except +1 Each except branch adds a new conditional path of execution.
finally +0 The finally block is unconditionally executed.
with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
assert +1 The assert statement internally roughly equals a conditional statement.
Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

Source: http://radon.readthedocs.org/en/latest/intro.html

Function exitAttributeValues has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def exitAttributeValues(self, ctx):
        self.log_insertion("AttributeValues")
        ctx.value = [x.value for x in ctx.items]
        values = []
        for attr in ctx.value:
Severity: Minor
Found in pydbc/dbcListener.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

Severity
Category
Status
Source
Language