cea-sec/miasm

View on GitHub

Showing 3,020 of 3,020 total issues

File sem.py has 358 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#-*- coding:utf-8 -*-

from miasm.expression.expression import *
from miasm.arch.msp430.regs import *
from miasm.arch.msp430.arch import mn_msp430
Severity: Minor
Found in miasm/arch/msp430/sem.py - About 4 hrs to fix

    Function add_dlldesc has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        def add_dlldesc(self, new_dll):
            if self.parent_head._wsize == 32:
                mask_ptr = 0x80000000
            elif self.parent_head._wsize == 64:
                mask_ptr = 0x8000000000000000
    Severity: Minor
    Found in miasm/loader/pe.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function add_dlldesc has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        def add_dlldesc(self, new_dll):
            rva_size = self.parent_head._wsize // 8
            if self.parent_head._wsize == 32:
                mask_ptr = 0x80000000
            elif self.parent_head._wsize == 64:
    Severity: Minor
    Found in miasm/loader/pe.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

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

    LLVMFunction has 34 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class LLVMFunction(object):
        """Represent a LLVM function
    
        Implementation note:
        A new module is created each time to avoid cumulative lag (if @new_module)
    Severity: Minor
    Found in miasm/jitter/llvmconvert.py - About 4 hrs to fix

      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

      Severity
      Category
      Status
      Source
      Language