cea-sec/miasm

View on GitHub

Showing 1,647 of 3,020 total issues

Identical blocks of code found in 7 locations. Consider refactoring.
Open

    @classmethod
    def gen_modes(cls, subcls, name, bases, dct, fields):
        dct['mode'] = None
        return [(subcls, name, bases, dct, fields)]
Severity: Major
Found in miasm/arch/sh4/arch.py and 6 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 569..572
miasm/arch/arm/arch.py on lines 741..744
miasm/arch/arm/arch.py on lines 839..842
miasm/arch/mips32/arch.py on lines 253..256
miasm/arch/msp430/arch.py on lines 301..304
miasm/arch/ppc/arch.py on lines 290..293

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

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

Identical blocks of code found in 7 locations. Consider refactoring.
Open

    @classmethod
    def gen_modes(cls, subcls, name, bases, dct, fields):
        dct['mode'] = None
        return [(subcls, name, bases, dct, fields)]
Severity: Major
Found in miasm/arch/arm/arch.py and 6 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 569..572
miasm/arch/arm/arch.py on lines 839..842
miasm/arch/mips32/arch.py on lines 253..256
miasm/arch/msp430/arch.py on lines 301..304
miasm/arch/ppc/arch.py on lines 290..293
miasm/arch/sh4/arch.py on lines 550..553

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

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

class LifterModelCallAarch64b(LifterModelCallAarch64bBase, LifterModelCallAarch64l):

    def __init__(self, loc_db):
        LifterModelCallAarch64bBase.__init__(self, loc_db)
        self.ret_reg = self.arch.regs.X0
Severity: Major
Found in miasm/arch/aarch64/lifter_model_call.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/lifter_model_call.py on lines 7..11
miasm/arch/aarch64/lifter_model_call.py on lines 14..18
miasm/arch/arm/lifter_model_call.py on lines 9..12
miasm/arch/arm/lifter_model_call.py on lines 14..17
miasm/arch/arm/lifter_model_call.py on lines 91..95
miasm/arch/arm/lifter_model_call.py on lines 98..101
miasm/arch/mips32/lifter_model_call.py on lines 101..104

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

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

aarch64op("bic",  [sf, bs('00'), bs('01010'), shift, bs('1'), rm_sft, imm6, rn, rd], [rd, rn, rm_sft])
Severity: Major
Found in miasm/arch/aarch64/arch.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 1970..1970
miasm/arch/aarch64/arch.py on lines 1972..1972
miasm/arch/aarch64/arch.py on lines 1973..1973
miasm/arch/aarch64/arch.py on lines 1975..1975
miasm/arch/aarch64/arch.py on lines 1976..1976
miasm/arch/aarch64/arch.py on lines 1977..1977
miasm/arch/aarch64/arch.py on lines 1979..1979

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

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

armop("smlal", [bs('000011'), bs('1'), scc, rd, rdl, rs, bs('1001'), rm], [rdl, rd, rm, rs])
Severity: Major
Found in miasm/arch/arm/arch.py and 4 other locations - About 45 mins to fix
miasm/arch/arm/arch.py on lines 1787..1787
miasm/arch/arm/arch.py on lines 1788..1788
miasm/arch/arm/arch.py on lines 1789..1789
miasm/arch/arm/arch.py on lines 1791..1791

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

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

aarch64op("and",  [sf, bs('00'), bs('01010'), shift, bs('0'), rm_sft, imm6, rn, rd], [rd, rn, rm_sft])
Severity: Major
Found in miasm/arch/aarch64/arch.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 1971..1971
miasm/arch/aarch64/arch.py on lines 1972..1972
miasm/arch/aarch64/arch.py on lines 1973..1973
miasm/arch/aarch64/arch.py on lines 1975..1975
miasm/arch/aarch64/arch.py on lines 1976..1976
miasm/arch/aarch64/arch.py on lines 1977..1977
miasm/arch/aarch64/arch.py on lines 1979..1979

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

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

aarch64op("orn",  [sf, bs('01'), bs('01010'), shift, bs('1'), rm_sft, imm6, rn, rd], [rd, rn, rm_sft])
Severity: Major
Found in miasm/arch/aarch64/arch.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 1970..1970
miasm/arch/aarch64/arch.py on lines 1971..1971
miasm/arch/aarch64/arch.py on lines 1972..1972
miasm/arch/aarch64/arch.py on lines 1975..1975
miasm/arch/aarch64/arch.py on lines 1976..1976
miasm/arch/aarch64/arch.py on lines 1977..1977
miasm/arch/aarch64/arch.py on lines 1979..1979

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

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

armtop("eor", [bs('11110'), imm12_1, bs('00100'), scc, rn, bs('0'), imm12_3, rd_nopc, imm12_8], [rd_nopc, rn, imm12_8])
Severity: Major
Found in miasm/arch/arm/arch.py and 5 other locations - About 45 mins to fix
miasm/arch/arm/arch.py on lines 3388..3388
miasm/arch/arm/arch.py on lines 3389..3389
miasm/arch/arm/arch.py on lines 3390..3390
miasm/arch/arm/arch.py on lines 3392..3392
miasm/arch/arm/arch.py on lines 3401..3401

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

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

Identical blocks of code found in 7 locations. Consider refactoring.
Open

    @classmethod
    def gen_modes(cls, subcls, name, bases, dct, fields):
        dct['mode'] = None
        return [(subcls, name, bases, dct, fields)]
Severity: Major
Found in miasm/arch/mips32/arch.py and 6 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 569..572
miasm/arch/arm/arch.py on lines 741..744
miasm/arch/arm/arch.py on lines 839..842
miasm/arch/msp430/arch.py on lines 301..304
miasm/arch/ppc/arch.py on lines 290..293
miasm/arch/sh4/arch.py on lines 550..553

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

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

Identical blocks of code found in 7 locations. Consider refactoring.
Open

    @classmethod
    def gen_modes(cls, subcls, name, bases, dct, fields):
        dct['mode'] = None
        return [(subcls, name, bases, dct, fields)]
Severity: Major
Found in miasm/arch/ppc/arch.py and 6 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 569..572
miasm/arch/arm/arch.py on lines 741..744
miasm/arch/arm/arch.py on lines 839..842
miasm/arch/mips32/arch.py on lines 253..256
miasm/arch/msp430/arch.py on lines 301..304
miasm/arch/sh4/arch.py on lines 550..553

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

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

Identical blocks of code found in 7 locations. Consider refactoring.
Open

    @classmethod
    def gen_modes(cls, subcls, name, bases, dct, fields):
        dct['mode'] = None
        return [(subcls, name, bases, dct, fields)]
Severity: Major
Found in miasm/arch/msp430/arch.py and 6 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 569..572
miasm/arch/arm/arch.py on lines 741..744
miasm/arch/arm/arch.py on lines 839..842
miasm/arch/mips32/arch.py on lines 253..256
miasm/arch/ppc/arch.py on lines 290..293
miasm/arch/sh4/arch.py on lines 550..553

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

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

armtop("rsb", [bs('11110'), imm12_1, bs('01110'), scc, rn_nosppc, bs('0'), imm12_3, rd, imm12_8], [rd, rn_nosppc, imm12_8])
Severity: Major
Found in miasm/arch/arm/arch.py and 5 other locations - About 45 mins to fix
miasm/arch/arm/arch.py on lines 3388..3388
miasm/arch/arm/arch.py on lines 3389..3389
miasm/arch/arm/arch.py on lines 3390..3390
miasm/arch/arm/arch.py on lines 3391..3391
miasm/arch/arm/arch.py on lines 3392..3392

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

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

armop("smull", [bs('000011'), bs('0'), scc, rd, rdl, rs, bs('1001'), rm], [rdl, rd, rm, rs])
Severity: Major
Found in miasm/arch/arm/arch.py and 4 other locations - About 45 mins to fix
miasm/arch/arm/arch.py on lines 1787..1787
miasm/arch/arm/arch.py on lines 1788..1788
miasm/arch/arm/arch.py on lines 1790..1790
miasm/arch/arm/arch.py on lines 1791..1791

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

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

aarch64op("eor",  [sf, bs('10'), bs('01010'), shift, bs('0'), rm_sft, imm6, rn, rd], [rd, rn, rm_sft])
Severity: Major
Found in miasm/arch/aarch64/arch.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 1970..1970
miasm/arch/aarch64/arch.py on lines 1971..1971
miasm/arch/aarch64/arch.py on lines 1972..1972
miasm/arch/aarch64/arch.py on lines 1973..1973
miasm/arch/aarch64/arch.py on lines 1976..1976
miasm/arch/aarch64/arch.py on lines 1977..1977
miasm/arch/aarch64/arch.py on lines 1979..1979

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

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

class LifterModelCallArmlBase(Lifter_Arml, LifterModelCall):
    def __init__(self, loc_db):
        Lifter_Arml.__init__(self, loc_db)
        self.ret_reg = self.arch.regs.R0
Severity: Major
Found in miasm/arch/arm/lifter_model_call.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/lifter_model_call.py on lines 7..11
miasm/arch/aarch64/lifter_model_call.py on lines 14..18
miasm/arch/aarch64/lifter_model_call.py on lines 46..50
miasm/arch/arm/lifter_model_call.py on lines 14..17
miasm/arch/arm/lifter_model_call.py on lines 91..95
miasm/arch/arm/lifter_model_call.py on lines 98..101
miasm/arch/mips32/lifter_model_call.py on lines 101..104

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

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

class LifterModelCallArmbBase(Lifter_Armb, LifterModelCall):
    def __init__(self, loc_db):
        Lifter_Armb.__init__(self, loc_db)
        self.ret_reg = self.arch.regs.R0
Severity: Major
Found in miasm/arch/arm/lifter_model_call.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/lifter_model_call.py on lines 7..11
miasm/arch/aarch64/lifter_model_call.py on lines 14..18
miasm/arch/aarch64/lifter_model_call.py on lines 46..50
miasm/arch/arm/lifter_model_call.py on lines 9..12
miasm/arch/arm/lifter_model_call.py on lines 91..95
miasm/arch/arm/lifter_model_call.py on lines 98..101
miasm/arch/mips32/lifter_model_call.py on lines 101..104

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

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

armtop("sub", [bs('11110'), imm12_1, bs('01101'), scc, rn, bs('0'), imm12_3, rd_nopc, imm12_8], [rd_nopc, rn, imm12_8])
Severity: Major
Found in miasm/arch/arm/arch.py and 5 other locations - About 45 mins to fix
miasm/arch/arm/arch.py on lines 3388..3388
miasm/arch/arm/arch.py on lines 3389..3389
miasm/arch/arm/arch.py on lines 3391..3391
miasm/arch/arm/arch.py on lines 3392..3392
miasm/arch/arm/arch.py on lines 3401..3401

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

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

armtop("add", [bs('11110'), imm12_1, bs('10000'), scc, rn_nosppc, bs('0'), imm12_3, rd, imm12_8_t4], [rd, rn_nosppc, imm12_8_t4])
Severity: Major
Found in miasm/arch/arm/arch.py and 5 other locations - About 45 mins to fix
miasm/arch/arm/arch.py on lines 3388..3388
miasm/arch/arm/arch.py on lines 3389..3389
miasm/arch/arm/arch.py on lines 3390..3390
miasm/arch/arm/arch.py on lines 3391..3391
miasm/arch/arm/arch.py on lines 3401..3401

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

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

aarch64op("ands", [sf, bs('11'), bs('01010'), shift, bs('0'), rm_sft, imm6, rn, rd], [rd, rn, rm_sft])
Severity: Major
Found in miasm/arch/aarch64/arch.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/arch.py on lines 1970..1970
miasm/arch/aarch64/arch.py on lines 1971..1971
miasm/arch/aarch64/arch.py on lines 1972..1972
miasm/arch/aarch64/arch.py on lines 1973..1973
miasm/arch/aarch64/arch.py on lines 1975..1975
miasm/arch/aarch64/arch.py on lines 1976..1976
miasm/arch/aarch64/arch.py on lines 1979..1979

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

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

class LifterModelCallArmb(LifterModelCallArmbBase, LifterModelCallArml):

    def __init__(self, loc_db):
        LifterModelCallArmbBase.__init__(self, loc_db)
        self.ret_reg = self.arch.regs.R0
Severity: Major
Found in miasm/arch/arm/lifter_model_call.py and 7 other locations - About 45 mins to fix
miasm/arch/aarch64/lifter_model_call.py on lines 7..11
miasm/arch/aarch64/lifter_model_call.py on lines 14..18
miasm/arch/aarch64/lifter_model_call.py on lines 46..50
miasm/arch/arm/lifter_model_call.py on lines 9..12
miasm/arch/arm/lifter_model_call.py on lines 14..17
miasm/arch/arm/lifter_model_call.py on lines 98..101
miasm/arch/mips32/lifter_model_call.py on lines 101..104

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

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