cea-sec/miasm

View on GitHub

Showing 1,647 of 3,020 total issues

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

def l_outs(_, instr, size):
    e = []
    e.append(m2_expr.ExprAssign(exception_flags,
                             m2_expr.ExprInt(EXCEPT_PRIV_INSN, 32)))
    return e, []
Severity: Major
Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
miasm/arch/mips32/sem.py on lines 403..406

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

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

    def __eq__(self, other):
        return (self.eq_base(other) and
                self.name == other.name and
                self.fields == other.fields)
Severity: Major
Found in miasm/core/ctypesmngr.py and 3 other locations - About 1 hr to fix
miasm/core/ctypesmngr.py on lines 96..99
miasm/core/ctypesmngr.py on lines 182..185
miasm/core/ctypesmngr.py on lines 303..306

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

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 is_addr_ro_variable(bs, addr, size):
        """
        Return True if address at @addr is a read-only variable.
        WARNING: Quick & Dirty

Severity: Major
Found in example/disasm/full.py and 1 other location - About 1 hr to fix
example/ida/graph_ir.py on lines 165..178

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

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 set_imm_to_size(self.parent.args[0].expr.size, self.expr.args[1]) is None:
            return False
Severity: Major
Found in miasm/arch/aarch64/arch.py and 1 other location - About 1 hr to fix
miasm/arch/aarch64/arch.py on lines 1490..1491

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

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

        if not os.access(self.tempdir, os.R_OK | os.W_OK):
            raise RuntimeError(
                'Cannot access cache directory %s ' % self.tempdir)
Severity: Major
Found in miasm/jitter/jitcore_llvm.py and 1 other location - About 1 hr to fix
miasm/jitter/jitcore_cc_base.py on lines 65..67

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

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 set_imm_to_size(self.parent.args[0].expr.size, self.expr.args[0]) is None:
            return False
Severity: Major
Found in miasm/arch/aarch64/arch.py and 1 other location - About 1 hr to fix
miasm/arch/aarch64/arch.py on lines 1492..1493

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

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 dis_aarch64l(disasmEngine):
    attrib = "l"
    def __init__(self, bs=None, **kwargs):
        super(dis_aarch64l, self).__init__(
            mn_aarch64, self.attrib, bs,
Severity: Major
Found in miasm/arch/aarch64/disasm.py and 1 other location - About 1 hr to fix
miasm/arch/aarch64/disasm.py on lines 12..16

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

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 syscall(ir, instr, code):
    e = []
    e.append(m2_expr.ExprAssign(exception_flags, m2_expr.ExprInt(EXCEPT_SYSCALL, 32)))
    return e, []
Severity: Major
Found in miasm/arch/mips32/sem.py and 1 other location - About 1 hr to fix
miasm/arch/x86/sem.py on lines 3449..3453

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

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 gen_uniq_name(self):
        """Generate uniq name for unnamed strucs/union"""
        cpt = self.cpt
        self.cpt += 1
        return self.INTERNAL_PREFIX + "%d" % cpt
Severity: Major
Found in miasm/core/ctypesmngr.py and 1 other location - About 1 hr to fix
miasm/core/ctypesmngr.py on lines 380..384

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

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 is_addr_ro_variable(bs, addr, size):
    """
    Return True if address at @addr is a read-only variable.
    WARNING: Quick & Dirty

Severity: Major
Found in example/ida/graph_ir.py and 1 other location - About 1 hr to fix
example/disasm/full.py on lines 285..298

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

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 dis_aarch64b(disasmEngine):
    attrib = "b"
    def __init__(self, bs=None, **kwargs):
        super(dis_aarch64b, self).__init__(
            mn_aarch64, self.attrib, bs,
Severity: Major
Found in miasm/arch/aarch64/disasm.py and 1 other location - About 1 hr to fix
miasm/arch/aarch64/disasm.py on lines 21..25

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

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 gen_anon_name(self):
        """Generate name for anonymous strucs/union"""
        cpt = self.cpt
        self.cpt += 1
        return self.ANONYMOUS_PREFIX + "%d" % cpt
Severity: Major
Found in miasm/core/ctypesmngr.py and 1 other location - About 1 hr to fix
miasm/core/ctypesmngr.py on lines 374..378

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

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

    b14 = (reversed_rm & i32(2**14)) >> i32(14) if b15 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b09 = (reversed_rm & i32(2 ** 9)) >> i32(9) if b10 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b31 = (reversed_rm & i32(2**31)) >> i32(31) if reversed_rm else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b28 = (reversed_rm & i32(2**28)) >> i32(28) if b29 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    elif (expr.is_op("CC_S>") and
          len(expr.args) == 3 and
          expr.args[0].is_op("FLAG_SIGN_SUB") and
          expr.args[2].is_op("FLAG_EQ_CMP") and
          expr.args[0].args == expr.args[2].args and
Severity: Major
Found in miasm/expression/simplifications_common.py and 6 other locations - About 1 hr to fix
miasm/expression/simplifications_common.py on lines 733..741
miasm/expression/simplifications_common.py on lines 757..765
miasm/expression/simplifications_common.py on lines 787..795
miasm/expression/simplifications_common.py on lines 823..833
miasm/expression/simplifications_common.py on lines 850..859
miasm/expression/simplifications_common.py on lines 906..915

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

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

    b30 = (reversed_rm & i32(2**30)) >> i32(30) if b31 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b27 = (reversed_rm & i32(2**27)) >> i32(27) if b28 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b23 = (reversed_rm & i32(2**23)) >> i32(23) if b24 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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