cea-sec/miasm

View on GitHub

Showing 1,646 of 3,019 total issues

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

@sbuild.parse
def bnei(reg_test, imm4, disp16):
    """BNEI - Branch if the register does not store imm4."""

    # if(Rn!=ZeroExt(imm4)) PC <- PC+SignExt((disp17)16..1||0)
Severity: Major
Found in miasm/arch/mep/sem.py and 1 other location - About 4 hrs to fix
miasm/arch/mep/sem.py on lines 599..607

Duplicated Code

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

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

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

Tuning

This issue has a mass of 82.

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

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

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

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

Refactorings

Further Reading

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

def fisub(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fisub', dst, src)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fsub(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fsub', dst, src)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fsubr(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fsub', src, dst)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fdiv(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fdiv', dst, src)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fdivr(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fdiv', src, dst)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fadd(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fadd', dst, src)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fiadd(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fiadd', dst, src)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fidiv(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fidiv', dst, src)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fidivr(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fidiv', src, dst)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828

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

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

def fisubr(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fisub', src, dst)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fmul(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fmul', dst, src)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2785..2791
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

def fimul(_, instr, dst, src=None):
    dst, src = float_implicit_st0(dst, src)
    e = []
    src = mem2double(instr, src)
    e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('fimul', dst, src)))
Severity: Major
Found in miasm/arch/x86/sem.py and 11 other locations - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 2536..2543
miasm/arch/x86/sem.py on lines 2546..2552
miasm/arch/x86/sem.py on lines 2555..2561
miasm/arch/x86/sem.py on lines 2564..2570
miasm/arch/x86/sem.py on lines 2738..2744
miasm/arch/x86/sem.py on lines 2757..2763
miasm/arch/x86/sem.py on lines 2776..2782
miasm/arch/x86/sem.py on lines 2794..2800
miasm/arch/x86/sem.py on lines 2803..2809
miasm/arch/x86/sem.py on lines 2822..2828
miasm/arch/x86/sem.py on lines 2831..2837

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

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

    def value(self, mode):
        v = super(mn_mips32, self).value(mode)
        if mode == 'l':
            return [x[::-1] for x in v]
        elif mode == 'b':
Severity: Major
Found in miasm/arch/mips32/arch.py and 2 other locations - About 4 hrs to fix
miasm/arch/aarch64/arch.py on lines 574..581
miasm/arch/arm/arch.py on lines 746..753

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

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

    def value(self, mode):
        v = super(mn_aarch64, self).value(mode)
        if mode == 'l':
            return [x[::-1] for x in v]
        elif mode == 'b':
Severity: Major
Found in miasm/arch/aarch64/arch.py and 2 other locations - About 4 hrs to fix
miasm/arch/arm/arch.py on lines 746..753
miasm/arch/mips32/arch.py on lines 258..265

Duplicated Code

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

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

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

Tuning

This issue has a mass of 80.

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

    def value(self, mode):
        v = super(mn_arm, self).value(mode)
        if mode == 'l':
            return [x[::-1] for x in v]
        elif mode == 'b':
Severity: Major
Found in miasm/arch/arm/arch.py and 2 other locations - About 4 hrs to fix
miasm/arch/aarch64/arch.py on lines 574..581
miasm/arch/mips32/arch.py on lines 258..265

Duplicated Code

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

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

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

Tuning

This issue has a mass of 80.

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

def literal_list(l):
    l = l[:]
    l.sort()
    l = l[::-1]
    o = pyparsing.Literal(l[0])
Severity: Major
Found in miasm/core/cpu.py and 1 other location - About 4 hrs to fix
miasm/core/cpu.py on lines 260..267

Duplicated Code

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

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

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

Tuning

This issue has a mass of 78.

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

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

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

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

Refactorings

Further Reading

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

    def ast_parse_struct(self, ast):
        """Parse ast Struct"""
        obj = self.ast_to_typeid(ast)
        if ast.decls and ast.name is not None:
            # Add struct to types if named
Severity: Major
Found in miasm/core/ctypesmngr.py and 1 other location - About 4 hrs to fix
miasm/core/ctypesmngr.py on lines 691..699

Duplicated Code

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

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

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

Tuning

This issue has a mass of 78.

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

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

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

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

Refactorings

Further Reading

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

@sbuild.parse
def mult(arg1, arg2):
    """Multiplies (signed) @arg1 by @arg2 and stores the result in $R_HI:$R_LO"""
    size = arg1.size
    result = arg1.signExtend(size * 2) * arg2.signExtend(size * 2)
Severity: Major
Found in miasm/arch/mips32/sem.py and 1 other location - About 4 hrs to fix
miasm/arch/mips32/sem.py on lines 482..488

Duplicated Code

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

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

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

Tuning

This issue has a mass of 78.

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

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

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

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

Refactorings

Further Reading

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

        if dst.op == "segm":
            # Far jmp segm:addr
            segm = dst.args[0]
            base = dst.args[1]
            m1 = segm.zeroExtend(CS.size)
Severity: Major
Found in miasm/arch/x86/sem.py and 1 other location - About 4 hrs to fix
miasm/arch/x86/sem.py on lines 1414..1428

Duplicated Code

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

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

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

Tuning

This issue has a mass of 78.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language