cea-sec/miasm

View on GitHub
miasm/arch/x86/sem.py

Summary

Maintainability
F
3 mos
Test Coverage

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

#
# Copyright (C) 2011 EADS France, Fabrice Desclaux <fabrice.desclaux@eads.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Severity: Major
Found in miasm/arch/x86/sem.py - About 1 wk to fix

    Function get_ir has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_ir(self, instr):
            args = instr.args[:]
            args = [arg.replace_expr(float_replace) for arg in args]
            args = fix_mem_args_size(instr, *args)
            my_ss = None
    Severity: Minor
    Found in miasm/arch/x86/sem.py - About 2 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 _shift_tpl has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    def _shift_tpl(op, ir, instr, a, b, c=None, op_inv=None, left=False,
                   custom_of=None):
        """Template to generate a shifter with operation @op
        A temporary basic block is generated to handle 0-shift
        @op: operation to execute
    Severity: Minor
    Found in miasm/arch/x86/sem.py - About 2 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 get_ir has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def get_ir(self, instr):
            args = instr.args[:]
            args = [arg.replace_expr(float_replace) for arg in args]
            args = fix_mem_args_size(instr, *args)
            my_ss = None
    Severity: Minor
    Found in miasm/arch/x86/sem.py - About 1 hr to fix

      Function irbloc_fix_regs_for_mode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def irbloc_fix_regs_for_mode(self, irblock, mode=64):
              irs = []
              for assignblk in irblock:
                  new_assignblk = dict(assignblk)
                  for dst, src in viewitems(assignblk):
      Severity: Minor
      Found in miasm/arch/x86/sem.py - About 1 hr 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 _shift_tpl has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _shift_tpl(op, ir, instr, a, b, c=None, op_inv=None, left=False,
      Severity: Major
      Found in miasm/arch/x86/sem.py - About 1 hr to fix

        Function _float_compare_to_mask has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        def _float_compare_to_mask(expr):
            if expr.op == 'unord':
                to_ext = m2_expr.expr_is_NaN(expr.args[0]) | m2_expr.expr_is_NaN(expr.args[1])
            elif expr.op == 'ord':
                to_ext = ~m2_expr.expr_is_NaN(expr.args[0]) & ~m2_expr.expr_is_NaN(expr.args[1])
        Severity: Minor
        Found in miasm/arch/x86/sem.py - About 1 hr 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 call has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def call(ir, instr, dst):
            e = []
            # opmode, admode = instr.opmode, instr.admode
            s = dst.size
            meip = mRIP[ir.IRDst.size]
        Severity: Minor
        Found in miasm/arch/x86/sem.py - About 55 mins 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 ps_rl_ll has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def ps_rl_ll(ir, instr, dst, src, op, size):
        Severity: Minor
        Found in miasm/arch/x86/sem.py - About 45 mins to fix

          Function gen_fcmov has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def gen_fcmov(ir, instr, cond, arg1, arg2, mov_if):
          Severity: Minor
          Found in miasm/arch/x86/sem.py - About 45 mins to fix

            Function _rotate_tpl has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def _rotate_tpl(ir, instr, dst, src, op, left=False):
            Severity: Minor
            Found in miasm/arch/x86/sem.py - About 45 mins to fix

              Function vec_vertical_sem has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def vec_vertical_sem(op, elt_size, reg_size, dst, src, apply_on_output):
              Severity: Minor
              Found in miasm/arch/x86/sem.py - About 45 mins to fix

                Function gen_cmov has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def gen_cmov(ir, instr, cond, dst, src, mov_if):
                Severity: Minor
                Found in miasm/arch/x86/sem.py - About 45 mins to fix

                  Function pextr has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def pextr(_, instr, dst, src, imm, size):
                  Severity: Minor
                  Found in miasm/arch/x86/sem.py - About 45 mins to fix

                    Function pinsr has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def pinsr(_, instr, dst, src, imm, size):
                    Severity: Minor
                    Found in miasm/arch/x86/sem.py - About 45 mins to fix

                      Function jmp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def jmp(ir, instr, dst):
                          e = []
                          meip = mRIP[ir.IRDst.size]
                      
                          if isinstance(dst, m2_expr.ExprOp):
                      Severity: Minor
                      Found in miasm/arch/x86/sem.py - About 45 mins 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 punpck has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def punpck(_, instr, dst, src, size, off):
                      Severity: Minor
                      Found in miasm/arch/x86/sem.py - About 45 mins to fix

                        Function _roundscalar has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def _roundscalar(ir, inst, dst, src, imm8, double):
                        Severity: Minor
                        Found in miasm/arch/x86/sem.py - About 45 mins to fix

                          Function shrd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def shrd(ir, instr, dst, src1, src2):
                          Severity: Minor
                          Found in miasm/arch/x86/sem.py - About 35 mins to fix

                            Function pcmpeq has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def pcmpeq(_, instr, dst, src, size):
                            Severity: Minor
                            Found in miasm/arch/x86/sem.py - About 35 mins to fix

                              Function pshuflw has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def pshuflw(_, instr, dst, src, imm):
                              Severity: Minor
                              Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                Function pshufhw has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def pshufhw(_, instr, dst, src, imm):
                                Severity: Minor
                                Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                  Function pshufd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def pshufd(_, instr, dst, src, imm):
                                  Severity: Minor
                                  Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                    Function gen_jcc has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def gen_jcc(ir, instr, cond, dst, jmp_if):
                                    Severity: Minor
                                    Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                      Function rotate_with_carry_tpl has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      def rotate_with_carry_tpl(ir, instr, op, dst, src):
                                      Severity: Minor
                                      Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                        Function shld has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        def shld(ir, instr, dst, src1, src2):
                                        Severity: Minor
                                        Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                          Function bsr_bsf has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                          def bsr_bsf(ir, instr, dst, src, op_func):
                                          Severity: Minor
                                          Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                            Function imul has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                            def imul(_, instr, src1, src2=None, src3=None):
                                            Severity: Minor
                                            Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                              Function pcmpgt has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                              def pcmpgt(_, instr, dst, src, size):
                                              Severity: Minor
                                              Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                Function pextrq has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                def pextrq(ir, instr, dst, src, imm):
                                                Severity: Minor
                                                Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                  Function sqrt_gen has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                  def sqrt_gen(_, instr, dst, src, size):
                                                  Severity: Minor
                                                  Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                    Function pinsrb has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                    def pinsrb(ir, instr, dst, src, imm):
                                                    Severity: Minor
                                                    Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                      Function pextrw has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                      def pextrw(ir, instr, dst, src, imm):
                                                      Severity: Minor
                                                      Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                        Function palignr has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                        def palignr(ir, instr, dst, src, imm):
                                                        Severity: Minor
                                                        Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                          Function roundss has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                          def roundss(ir, inst, dst, src, imm8):
                                                          Severity: Minor
                                                          Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                            Function pextrb has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                            def pextrb(ir, instr, dst, src, imm):
                                                            Severity: Minor
                                                            Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                              Function shufps has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                              def shufps(ir, instr, dst, src, imm8):
                                                              Severity: Minor
                                                              Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                                Function pinsrw has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                def pinsrw(ir, instr, dst, src, imm):
                                                                Severity: Minor
                                                                Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                                  Function roundsd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                  def roundsd(ir, inst, dst, src, imm8):
                                                                  Severity: Minor
                                                                  Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                                    Function pinsrd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                    Open

                                                                    def pinsrd(ir, instr, dst, src, imm):
                                                                    Severity: Minor
                                                                    Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                                      Function pextrd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                      Open

                                                                      def pextrd(ir, instr, dst, src, imm):
                                                                      Severity: Minor
                                                                      Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                                        Function pinsrq has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                        Open

                                                                        def pinsrq(ir, instr, dst, src, imm):
                                                                        Severity: Minor
                                                                        Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                                          Function shufpd has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                          Open

                                                                          def shufpd(ir, instr, dst, src, imm8):
                                                                          Severity: Minor
                                                                          Found in miasm/arch/x86/sem.py - About 35 mins to fix

                                                                            Function fstp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            def fstp(ir, instr, dst):
                                                                                e = []
                                                                            
                                                                                if isinstance(dst, m2_expr.ExprMem) and dst.size > 64:
                                                                                    raise NotImplementedError('convert to 80bits')
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 35 mins 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 _rotate_tpl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            def _rotate_tpl(ir, instr, dst, src, op, left=False):
                                                                                '''Template to generate a rotater with operation @op
                                                                                A temporary basic block is generated to handle 0-rotate
                                                                                @op: operation to execute
                                                                                @left (optional): indicates a left rotate if set, default is False
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 35 mins 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 imul has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            def imul(_, instr, src1, src2=None, src3=None):
                                                                                e = []
                                                                                size = src1.size
                                                                                if src2 is None:
                                                                                    if size in [16, 32, 64]:
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 35 mins 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 mod_pc has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                                def mod_pc(self, instr, instr_ir, extra_ir):
                                                                                    # fix RIP for 64 bit
                                                                                    pc_fixed = {self.pc: m2_expr.ExprInt(instr.offset + instr.l, 64)}
                                                                            
                                                                                    for i, expr in enumerate(instr_ir):
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 35 mins 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 maskmovq has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            def maskmovq(ir, instr, src, mask):
                                                                                loc_next = ir.get_next_loc_key(instr)
                                                                                loc_next_expr = m2_expr.ExprLoc(loc_next, ir.IRDst.size)
                                                                                blks = []
                                                                            
                                                                            
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 25 mins 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 lods has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            def lods(ir, instr, size):
                                                                                loc_df_0, loc_df_0_expr = ir.gen_loc_key_and_expr(ir.IRDst.size)
                                                                                loc_df_1, loc_df_1_expr = ir.gen_loc_key_and_expr(ir.IRDst.size)
                                                                                loc_next_expr = m2_expr.ExprLoc(ir.get_next_loc_key(instr), ir.IRDst.size)
                                                                                e = []
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 25 mins 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 fix_mem_args_size has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            def fix_mem_args_size(instr, *args):
                                                                                out = []
                                                                                for arg in args:
                                                                                    if not arg.is_mem():
                                                                                        out.append(arg)
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 25 mins 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 rotate_with_carry_tpl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            def rotate_with_carry_tpl(ir, instr, op, dst, src):
                                                                                # Compute results
                                                                                shifter = get_shift(dst, src).zeroExtend(dst.size + 1)
                                                                                result = m2_expr.ExprOp(op, m2_expr.ExprCompose(dst, cf), shifter)
                                                                            
                                                                            
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 25 mins 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 bittest_get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                            Open

                                                                            def bittest_get(ir, instr, src, index):
                                                                                index = index.zeroExtend(src.size)
                                                                                if isinstance(src, m2_expr.ExprMem):
                                                                                    b_mask = {16: 4, 32: 5, 64: 6}
                                                                                    b_decal = {16: 1, 32: 3, 64: 7}
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py - About 25 mins 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 2 locations. Consider refactoring.
                                                                            Open

                                                                            def div(ir, instr, src1):
                                                                                e = []
                                                                                size = src1.size
                                                                                if size == 8:
                                                                                    src2 = mRAX[instr.mode][:16]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 4 days to fix
                                                                            miasm/arch/x86/sem.py on lines 1770..1812

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

                                                                            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 idiv(ir, instr, src1):
                                                                                e = []
                                                                                size = src1.size
                                                                            
                                                                                if size == 8:
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 4 days to fix
                                                                            miasm/arch/x86/sem.py on lines 1724..1765

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

                                                                            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 comisd(_, instr, dst, src):
                                                                                # TODO unordered float
                                                                            
                                                                                e = []
                                                                            
                                                                            
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 2350..2367

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

                                                                            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 comiss(_, instr, dst, src):
                                                                                # TODO unordered float
                                                                            
                                                                                e = []
                                                                            
                                                                            
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 2370..2387

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

                                                                            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 ucomisd(_, instr, src1, src2):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(zf, m2_expr.ExprOp(
                                                                                    'ucomisd_zf', src1[:64], src2[:64])))
                                                                                e.append(m2_expr.ExprAssign(pf, m2_expr.ExprOp(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4341..4354

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

                                                                            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 ucomiss(_, instr, src1, src2):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(zf, m2_expr.ExprOp(
                                                                                    'ucomiss_zf', src1[:32], src2[:32])))
                                                                                e.append(m2_expr.ExprAssign(pf, m2_expr.ExprOp(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4356..4369

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

                                                                            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 cvtdq2ps(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('sint_to_fp', src[:32])))
                                                                                e.append(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4208..4218

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

                                                                            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 cvtps2dq(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('fp_to_sint32', src[:32])))
                                                                                e.append(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4135..4145

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

                                                                            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 pcmpeq(_, instr, dst, src, size):
                                                                                e = []
                                                                                for i in range(0, dst.size, size):
                                                                                    test = m2_expr.expr_is_equal(dst[i:i + size], src[i:i + size])
                                                                                    e.append(m2_expr.ExprAssign(dst[i:i + size],
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4516..4524

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

                                                                            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 pcmpgt(_, instr, dst, src, size):
                                                                                e = []
                                                                                for i in range(0, dst.size, size):
                                                                                    test = m2_expr.expr_is_signed_greater(dst[i:i + size], src[i:i + size])
                                                                                    e.append(m2_expr.ExprAssign(dst[i:i + size],
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4505..4513

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

                                                                            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 cvtpd2ps(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('fpconvert_fp32', src[:64])))
                                                                                e.append(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4148..4155

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

                                                                            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 _saturation_sub_unsigned(expr):
                                                                                assert expr.is_op("+") and len(expr.args) == 2 and expr.args[-1].is_op("-")
                                                                            
                                                                                # Compute the soustraction on one more bit to be able to distinguish cases:
                                                                                # 0x48 - 0xd7 in 8 bit, should saturate
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4911..4917

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

                                                                            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 _saturation_sub_signed(expr):
                                                                                assert expr.is_op("+") and len(expr.args) == 2 and expr.args[-1].is_op("-")
                                                                            
                                                                                # Compute the subtraction on two more bits, see _saturation_sub_unsigned
                                                                                arg1 = expr.args[0].signExtend(expr.size + 2)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4902..4909

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

                                                                            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 cvtpd2dq(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('fp_to_sint32', src[:64])))
                                                                                e.append(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 day to fix
                                                                            miasm/arch/x86/sem.py on lines 4167..4174

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

                                                                            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 cmpxchg16b(arg1):
                                                                                accumulator = {mRAX[64], mRDX[64]}
                                                                                if accumulator - arg1:
                                                                                    zf = i1(0)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 7 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3573..3582

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

                                                                            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 cmpxchg8b(arg1):
                                                                                accumulator = {mRAX[32], mRDX[32]}
                                                                                if accumulator - arg1:
                                                                                    zf = i1(0)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 7 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3585..3594

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

                                                                            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 cqo(_, instr):
                                                                                # Only in 64 bit
                                                                                e = []
                                                                                tempRAX = mRAX[instr.mode][:64]
                                                                                tempRDX = mRDX[instr.mode][:64]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 7 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1919..1927

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

                                                                            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 cwd(_, instr):
                                                                                # Only in 16 bit
                                                                                e = []
                                                                                tempAX = mRAX[instr.mode][:16]
                                                                                tempDX = mRDX[instr.mode][:16]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 7 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1940..1948

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

                                                                            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 neg(_, instr, src):
                                                                                e = []
                                                                                dst = m2_expr.ExprInt(0, src.size)
                                                                                arg1, arg2 = dst, src
                                                                                result = arg1 - arg2
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 885..896

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

                                                                            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 dec(_, instr, dst):
                                                                                e = []
                                                                                src = m2_expr.ExprInt(1, dst.size)
                                                                                arg1, arg2 = dst, src
                                                                                result = dst - src
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 531..541

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def les(ir, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, ir.ExprMem(src.ptr, size=dst.size)))
                                                                                ES_value = ir.ExprMem(src.ptr + m2_expr.ExprInt(dst.size // 8, src.ptr.size),
                                                                                                      size=16)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3597..3603
                                                                            miasm/arch/x86/sem.py on lines 3615..3621
                                                                            miasm/arch/x86/sem.py on lines 3624..3630
                                                                            miasm/arch/x86/sem.py on lines 3633..3639

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

                                                                            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 size in [16, 32, 64]:
                                                                                        result = m2_expr.ExprOp('*',
                                                                                                                mRAX[size].signExtend(size * 2),
                                                                                                                src1.signExtend(size * 2))
                                                                                        e.append(m2_expr.ExprAssign(mRAX[size], result[:size]))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1821..1826

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def lds(ir, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, ir.ExprMem(src.ptr, size=dst.size)))
                                                                                DS_value = ir.ExprMem(src.ptr + m2_expr.ExprInt(dst.size // 8, src.ptr.size),
                                                                                                      size=16)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3606..3612
                                                                            miasm/arch/x86/sem.py on lines 3615..3621
                                                                            miasm/arch/x86/sem.py on lines 3624..3630
                                                                            miasm/arch/x86/sem.py on lines 3633..3639

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def lfs(ir, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, ir.ExprMem(src.ptr, size=dst.size)))
                                                                                FS_value = ir.ExprMem(src.ptr + m2_expr.ExprInt(dst.size // 8, src.ptr.size),
                                                                                                      size=16)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3597..3603
                                                                            miasm/arch/x86/sem.py on lines 3606..3612
                                                                            miasm/arch/x86/sem.py on lines 3615..3621
                                                                            miasm/arch/x86/sem.py on lines 3633..3639

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def lss(ir, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, ir.ExprMem(src.ptr, size=dst.size)))
                                                                                SS_value = ir.ExprMem(src.ptr + m2_expr.ExprInt(dst.size // 8, src.ptr.size),
                                                                                                      size=16)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3597..3603
                                                                            miasm/arch/x86/sem.py on lines 3606..3612
                                                                            miasm/arch/x86/sem.py on lines 3624..3630
                                                                            miasm/arch/x86/sem.py on lines 3633..3639

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

                                                                            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 src1.size in [16, 32, 64]:
                                                                                    result = m2_expr.ExprOp('*',
                                                                                                            mRAX[size].zeroExtend(size * 2),
                                                                                                            src1.zeroExtend(size * 2))
                                                                                    e.append(m2_expr.ExprAssign(mRAX[size], result[:size]))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1850..1855

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def lgs(ir, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, ir.ExprMem(src.ptr, size=dst.size)))
                                                                                GS_value = ir.ExprMem(src.ptr + m2_expr.ExprInt(dst.size // 8, src.ptr.size),
                                                                                                      size=16)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3597..3603
                                                                            miasm/arch/x86/sem.py on lines 3606..3612
                                                                            miasm/arch/x86/sem.py on lines 3615..3621
                                                                            miasm/arch/x86/sem.py on lines 3624..3630

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

                                                                            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 cvtdq2pd(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst[:64],
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4177..4196

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

                                                                            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 cvtpi2pd(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst[:64],
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 6 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4112..4132

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def fsubp(_, instr, dst, src=None):
                                                                                dst, src = float_implicit_st0(dst, src)
                                                                                e = []
                                                                                src = mem2double(instr, src)
                                                                                e.append(m2_expr.ExprAssign(float_prev(dst), m2_expr.ExprOp('fsub', dst, src)))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2607..2614
                                                                            miasm/arch/x86/sem.py on lines 2766..2773
                                                                            miasm/arch/x86/sem.py on lines 2812..2819
                                                                            miasm/arch/x86/sem.py on lines 2840..2848
                                                                            miasm/arch/x86/sem.py on lines 2851..2859

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def fdivrp(_, instr, dst, src=None):
                                                                                dst, src = float_implicit_st0(dst, src)
                                                                                e = []
                                                                                src = mem2double(instr, src)
                                                                                e.append(m2_expr.ExprAssign(float_prev(dst), m2_expr.ExprOp('fdiv', src, dst)))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2607..2614
                                                                            miasm/arch/x86/sem.py on lines 2747..2754
                                                                            miasm/arch/x86/sem.py on lines 2766..2773
                                                                            miasm/arch/x86/sem.py on lines 2840..2848
                                                                            miasm/arch/x86/sem.py on lines 2851..2859

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def faddp(_, instr, dst, src=None):
                                                                                dst, src = float_implicit_st0(dst, src)
                                                                                e = []
                                                                                src = mem2double(instr, src)
                                                                                e.append(m2_expr.ExprAssign(float_prev(dst), m2_expr.ExprOp('fadd', dst, src)))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2747..2754
                                                                            miasm/arch/x86/sem.py on lines 2766..2773
                                                                            miasm/arch/x86/sem.py on lines 2812..2819
                                                                            miasm/arch/x86/sem.py on lines 2840..2848
                                                                            miasm/arch/x86/sem.py on lines 2851..2859

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def fdivp(_, instr, dst, src=None):
                                                                                # Invalid emulation
                                                                                dst, src = float_implicit_st0(dst, src)
                                                                                e = []
                                                                                src = mem2double(instr, src)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2607..2614
                                                                            miasm/arch/x86/sem.py on lines 2747..2754
                                                                            miasm/arch/x86/sem.py on lines 2766..2773
                                                                            miasm/arch/x86/sem.py on lines 2812..2819
                                                                            miasm/arch/x86/sem.py on lines 2851..2859

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def fmulp(_, instr, dst, src=None):
                                                                                # Invalid emulation
                                                                                dst, src = float_implicit_st0(dst, src)
                                                                                e = []
                                                                                src = mem2double(instr, src)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2607..2614
                                                                            miasm/arch/x86/sem.py on lines 2747..2754
                                                                            miasm/arch/x86/sem.py on lines 2766..2773
                                                                            miasm/arch/x86/sem.py on lines 2812..2819
                                                                            miasm/arch/x86/sem.py on lines 2840..2848

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def fsubrp(_, instr, dst, src=None):
                                                                                dst, src = float_implicit_st0(dst, src)
                                                                                e = []
                                                                                src = mem2double(instr, src)
                                                                                e.append(m2_expr.ExprAssign(float_prev(dst), m2_expr.ExprOp('fsub', src, dst)))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2607..2614
                                                                            miasm/arch/x86/sem.py on lines 2747..2754
                                                                            miasm/arch/x86/sem.py on lines 2812..2819
                                                                            miasm/arch/x86/sem.py on lines 2840..2848
                                                                            miasm/arch/x86/sem.py on lines 2851..2859

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

                                                                            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 cvtpd2pi(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('fp_to_sint32', src[:64])))
                                                                                e.append(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4199..4205
                                                                            miasm/arch/x86/sem.py on lines 4221..4227
                                                                            miasm/arch/x86/sem.py on lines 4230..4236

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

                                                                            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 cvtpi2ps(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('sint_to_fp', src[:32])))
                                                                                e.append(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4158..4164
                                                                            miasm/arch/x86/sem.py on lines 4221..4227
                                                                            miasm/arch/x86/sem.py on lines 4230..4236

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

                                                                            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 cvtps2pd(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:64], m2_expr.ExprOp('fpconvert_fp64', src[:32])))
                                                                                e.append(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4158..4164
                                                                            miasm/arch/x86/sem.py on lines 4199..4205
                                                                            miasm/arch/x86/sem.py on lines 4230..4236

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

                                                                            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 movmskpd(ir, instr, dst, src):
                                                                                out = []
                                                                                for i in range(2):
                                                                                    out.append(src[(64 * i) + 63:(64 * i) + 64])
                                                                                return [m2_expr.ExprAssign(dst, m2_expr.ExprCompose(*out).zeroExtend(dst.size))], []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 5094..5098

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

                                                                            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 movmskps(ir, instr, dst, src):
                                                                                out = []
                                                                                for i in range(4):
                                                                                    out.append(src[(32 * i) + 31:(32 * i) + 32])
                                                                                return [m2_expr.ExprAssign(dst, m2_expr.ExprCompose(*out).zeroExtend(dst.size))], []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 5100..5104

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

                                                                            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 cvtps2pi(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('fp_to_sint32', src[:32])))
                                                                                e.append(
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4158..4164
                                                                            miasm/arch/x86/sem.py on lines 4199..4205
                                                                            miasm/arch/x86/sem.py on lines 4221..4227

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

                                                                            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 packsswb(ir, instr, dst, src):
                                                                                out = []
                                                                                for source in [dst, src]:
                                                                                    for start in range(0, dst.size, 16):
                                                                                        out.append(_signed_to_signed_saturation(source[start:start + 16], 8))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4886..4891
                                                                            miasm/arch/x86/sem.py on lines 4894..4899

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

                                                                            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 packssdw(ir, instr, dst, src):
                                                                                out = []
                                                                                for source in [dst, src]:
                                                                                    for start in range(0, dst.size, 32):
                                                                                        out.append(_signed_to_signed_saturation(source[start:start + 32], 16))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4878..4883
                                                                            miasm/arch/x86/sem.py on lines 4894..4899

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

                                                                            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 packuswb(ir, instr, dst, src):
                                                                                out = []
                                                                                for source in [dst, src]:
                                                                                    for start in range(0, dst.size, 16):
                                                                                        out.append(_signed_to_unsigned_saturation(source[start:start + 16], 8))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 5 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4878..4883
                                                                            miasm/arch/x86/sem.py on lines 4886..4891

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

                                                                            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 __init__(self, loc_db):
                                                                                    Lifter.__init__(self, mn_x86, 16, loc_db)
                                                                                    self.do_stk_segm = False
                                                                                    self.do_ds_segm = False
                                                                                    self.do_str_segm = False
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 4 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 5894..5905
                                                                            miasm/arch/x86/sem.py on lines 5910..5919

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

                                                                                def __init__(self, loc_db):
                                                                                    Lifter.__init__(self, mn_x86, 64, loc_db)
                                                                                    self.do_stk_segm = False
                                                                                    self.do_ds_segm = False
                                                                                    self.do_str_segm = False
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 4 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 5753..5765
                                                                            miasm/arch/x86/sem.py on lines 5894..5905

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

                                                                            class Lifter_X86_32(Lifter_X86_16):
                                                                            
                                                                                def __init__(self, loc_db):
                                                                                    Lifter.__init__(self, mn_x86, 32, loc_db)
                                                                                    self.do_stk_segm = False
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 4 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 5753..5765
                                                                            miasm/arch/x86/sem.py on lines 5910..5919

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

                                                                            def cbw(_, instr):
                                                                                # Only in 16 bit
                                                                                e = []
                                                                                tempAL = mRAX[instr.v_opmode()][:8]
                                                                                tempAX = mRAX[instr.v_opmode()][:16]
                                                                            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 1901..1907

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

                                                                            def cwde(_, instr):
                                                                                # Only in 32/64 bit
                                                                                e = []
                                                                                tempAX = mRAX[instr.v_opmode()][:16]
                                                                                tempEAX = mRAX[instr.v_opmode()][:32]
                                                                            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 1892..1898

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

                                                                            def unpcklps(_, instr, dst, src):
                                                                                e = []
                                                                                src = m2_expr.ExprCompose(dst[0:32], src[0:32], dst[32:64], src[32:64])
                                                                                e.append(m2_expr.ExprAssign(dst, src))
                                                                                return e, []
                                                                            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 4658..4662

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

                                                                            def unpckhps(_, instr, dst, src):
                                                                                e = []
                                                                                src = m2_expr.ExprCompose(dst[64:96], src[64:96], dst[96:128], src[96:128])
                                                                                e.append(m2_expr.ExprAssign(dst, src))
                                                                                return e, []
                                                                            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 4672..4676

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

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

                                                                                    if dst.op == "segm":
                                                                                        # Far call segm:addr
                                                                                        if instr.mode not in [16, 32]:
                                                                                            raise RuntimeError('not supported')
                                                                                        segm = dst.args[0]
                                                                            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 1544..1556

                                                                            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 fyl2x(_, instr):
                                                                                e = []
                                                                                a = float_st1
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(float_prev(a), m2_expr.ExprOp('fyl2x', float_st0, float_st1)))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2573..2580

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

                                                                            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 fpatan(_, instr):
                                                                                e = []
                                                                                a = float_st1
                                                                                e.append(m2_expr.ExprAssign(float_prev(a),
                                                                                                         m2_expr.ExprOp('fpatan', float_st0, float_st1)))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2623..2630

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

                                                                            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

                                                                                    for idx, irblock in enumerate(extra_ir):
                                                                                        extra_ir[idx] = irblock.modify_exprs(lambda expr: expr.replace_expr(pc_fixed) \
                                                                                                                             if expr != self.pc else expr,
                                                                                                                             lambda expr: expr.replace_expr(pc_fixed))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/aarch64/sem.py on lines 2354..2357

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                    IRBlock(ir.loc_db, locs["NaN"][0], [AssignBlock({
                                                                                        float_c0: m2_expr.ExprInt(1, float_c0.size),
                                                                                        float_c2: m2_expr.ExprInt(0, float_c2.size),
                                                                                        float_c3: m2_expr.ExprInt(0, float_c3.size),
                                                                                        ir.IRDst: loc_next_expr,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2218..2223
                                                                            miasm/arch/x86/sem.py on lines 2224..2229
                                                                            miasm/arch/x86/sem.py on lines 2236..2241
                                                                            miasm/arch/x86/sem.py on lines 2242..2247

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                    IRBlock(ir.loc_db, locs["Denormal"][0], [AssignBlock({
                                                                                        float_c0: m2_expr.ExprInt(0, float_c0.size),
                                                                                        float_c2: m2_expr.ExprInt(1, float_c2.size),
                                                                                        float_c3: m2_expr.ExprInt(1, float_c3.size),
                                                                                        ir.IRDst: loc_next_expr,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2218..2223
                                                                            miasm/arch/x86/sem.py on lines 2230..2235
                                                                            miasm/arch/x86/sem.py on lines 2236..2241
                                                                            miasm/arch/x86/sem.py on lines 2242..2247

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                    IRBlock(ir.loc_db, locs["Normal"][0], [AssignBlock({
                                                                                        float_c0: m2_expr.ExprInt(0, float_c0.size),
                                                                                        float_c2: m2_expr.ExprInt(1, float_c2.size),
                                                                                        float_c3: m2_expr.ExprInt(0, float_c3.size),
                                                                                        ir.IRDst: loc_next_expr,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2218..2223
                                                                            miasm/arch/x86/sem.py on lines 2224..2229
                                                                            miasm/arch/x86/sem.py on lines 2230..2235
                                                                            miasm/arch/x86/sem.py on lines 2236..2241

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                    IRBlock(ir.loc_db, locs["Zero"][0], [AssignBlock({
                                                                                        float_c0: m2_expr.ExprInt(0, float_c0.size),
                                                                                        float_c2: m2_expr.ExprInt(0, float_c2.size),
                                                                                        float_c3: m2_expr.ExprInt(1, float_c3.size),
                                                                                        ir.IRDst: loc_next_expr,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2224..2229
                                                                            miasm/arch/x86/sem.py on lines 2230..2235
                                                                            miasm/arch/x86/sem.py on lines 2236..2241
                                                                            miasm/arch/x86/sem.py on lines 2242..2247

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                    IRBlock(ir.loc_db, locs["Infinity"][0], [AssignBlock({
                                                                                        float_c0: m2_expr.ExprInt(1, float_c0.size),
                                                                                        float_c2: m2_expr.ExprInt(1, float_c2.size),
                                                                                        float_c3: m2_expr.ExprInt(0, float_c3.size),
                                                                                        ir.IRDst: loc_next_expr,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2218..2223
                                                                            miasm/arch/x86/sem.py on lines 2224..2229
                                                                            miasm/arch/x86/sem.py on lines 2230..2235
                                                                            miasm/arch/x86/sem.py on lines 2242..2247

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

                                                                            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 lar(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('access_segment', src)))
                                                                                e.append(m2_expr.ExprAssign(zf, m2_expr.ExprOp('access_segment_ok', src)))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3669..3673

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

                                                                            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 lsl(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('load_segment_limit', src)))
                                                                                e.append(m2_expr.ExprAssign(zf, m2_expr.ExprOp('load_segment_limit_ok', src)))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3662..3666

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

                                                                            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 unpckhpd(_, instr, dst, src):
                                                                                e = []
                                                                                src = m2_expr.ExprCompose(dst[64:128], src[64:128])
                                                                                e.append(m2_expr.ExprAssign(dst, src))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4679..4683

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

                                                                            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 unpcklpd(_, instr, dst, src):
                                                                                e = []
                                                                                src = m2_expr.ExprCompose(dst[0:64], src[0:64])
                                                                                e.append(m2_expr.ExprAssign(dst, src))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4665..4669

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                for i in range(4):
                                                                                    shift = ((control >> (i * 2)) & 3) * 16
                                                                                    out.append(src[shift: shift + 16])
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4394..4398

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                for i in range(4):
                                                                                    shift = ((control >> (i * 2)) & 3) * 32
                                                                                    # shift is 2 bits long, expr.size is 128
                                                                                    # => shift + 32 <= src.size
                                                                                    out.append(src[shift: shift + 32])
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 3 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4405..4407

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

                                                                            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 check_ops_msb(a, b, c):
                                                                                if not a or not b or not c or a != b or a != c:
                                                                                    raise ValueError('bad ops size %s %s %s' % (a, b, c))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/aarch64/sem.py on lines 767..769

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

                                                                            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 setno(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1097..1109

                                                                            Duplicated Code

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

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

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

                                                                            Tuning

                                                                            This issue has a mass of 61.

                                                                            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 setnp(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1145..1157

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

                                                                            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 ir.do_str_segm:
                                                                                    if instr.additional_info.g2.value:
                                                                                        raise NotImplementedError("add segm support")
                                                                                    src1_sgm = ir.gen_segm_expr(DS, src1)
                                                                                    src2_sgm = ir.gen_segm_expr(ES, src2)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2036..2044

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

                                                                            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 ir.do_str_segm:
                                                                                    if instr.additional_info.g2.value:
                                                                                        raise NotImplementedError("add segm support")
                                                                                    src_sgm = ir.gen_segm_expr(DS, src)
                                                                                    dst_sgm = ir.gen_segm_expr(ES, dst)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1206..1213

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

                                                                            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

                                                                            def cvtss2si(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('fp_to_sint32', src[:32])))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4239..4243
                                                                            miasm/arch/x86/sem.py on lines 4246..4250
                                                                            miasm/arch/x86/sem.py on lines 4267..4271
                                                                            miasm/arch/x86/sem.py on lines 4274..4278
                                                                            miasm/arch/x86/sem.py on lines 4752..4757
                                                                            miasm/arch/x86/sem.py on lines 4760..4765

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

                                                                            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

                                                                            def sqrtsd(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst[:64],
                                                                                                         m2_expr.ExprOp('fsqrt',
                                                                                                                        src[:64])))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4239..4243
                                                                            miasm/arch/x86/sem.py on lines 4246..4250
                                                                            miasm/arch/x86/sem.py on lines 4267..4271
                                                                            miasm/arch/x86/sem.py on lines 4274..4278
                                                                            miasm/arch/x86/sem.py on lines 4281..4285
                                                                            miasm/arch/x86/sem.py on lines 4760..4765

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

                                                                            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

                                                                            def cvtsd2ss(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('fpconvert_fp32', src[:64])))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4239..4243
                                                                            miasm/arch/x86/sem.py on lines 4267..4271
                                                                            miasm/arch/x86/sem.py on lines 4274..4278
                                                                            miasm/arch/x86/sem.py on lines 4281..4285
                                                                            miasm/arch/x86/sem.py on lines 4752..4757
                                                                            miasm/arch/x86/sem.py on lines 4760..4765

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

                                                                            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

                                                                            def cvtsd2si(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('fp_to_sint32', src[:64])))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4246..4250
                                                                            miasm/arch/x86/sem.py on lines 4267..4271
                                                                            miasm/arch/x86/sem.py on lines 4274..4278
                                                                            miasm/arch/x86/sem.py on lines 4281..4285
                                                                            miasm/arch/x86/sem.py on lines 4752..4757
                                                                            miasm/arch/x86/sem.py on lines 4760..4765

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

                                                                            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

                                                                            def cvtss2sd(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:64], m2_expr.ExprOp('fpconvert_fp64', src[:32])))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4239..4243
                                                                            miasm/arch/x86/sem.py on lines 4246..4250
                                                                            miasm/arch/x86/sem.py on lines 4267..4271
                                                                            miasm/arch/x86/sem.py on lines 4281..4285
                                                                            miasm/arch/x86/sem.py on lines 4752..4757
                                                                            miasm/arch/x86/sem.py on lines 4760..4765

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

                                                                            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

                                                                            def sqrtss(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst[:32],
                                                                                                         m2_expr.ExprOp('fsqrt',
                                                                                                                        src[:32])))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4239..4243
                                                                            miasm/arch/x86/sem.py on lines 4246..4250
                                                                            miasm/arch/x86/sem.py on lines 4267..4271
                                                                            miasm/arch/x86/sem.py on lines 4274..4278
                                                                            miasm/arch/x86/sem.py on lines 4281..4285
                                                                            miasm/arch/x86/sem.py on lines 4752..4757

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

                                                                            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

                                                                            def cvtsi2ss(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(dst[:32], m2_expr.ExprOp('sint_to_fp', src[:32])))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4239..4243
                                                                            miasm/arch/x86/sem.py on lines 4246..4250
                                                                            miasm/arch/x86/sem.py on lines 4274..4278
                                                                            miasm/arch/x86/sem.py on lines 4281..4285
                                                                            miasm/arch/x86/sem.py on lines 4752..4757
                                                                            miasm/arch/x86/sem.py on lines 4760..4765

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

                                                                            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 setnz(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1053..1061

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

                                                                            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 setns(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 965..973

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

                                                                            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

                                                                                        to_ext = ~(m2_expr.expr_is_float_equal(expr.args[0], expr.args[1]) |
                                                                                                  m2_expr.expr_is_float_lower(expr.args[0], expr.args[1]))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4029..4030

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

                                                                            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

                                                                                        to_ext = (m2_expr.expr_is_float_equal(expr.args[0], expr.args[1]) |
                                                                                                  m2_expr.expr_is_float_lower(expr.args[0], expr.args[1]))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 4039..4040

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

                                                                            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 fcomp(ir, instr, dst=None, src=None):
                                                                                e, extra = fcom(ir, instr, dst, src)
                                                                                e += float_pop()
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, extra
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2297..2301

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

                                                                            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 fprem1(_, instr):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('fprem1', float_st0, float_st1)))
                                                                                e += set_float_cs_eip(instr)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2940..2945

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

                                                                            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 fcomip(ir, instr, dst=None, src=None):
                                                                                e, extra = fcomi(ir, instr, dst, src)
                                                                                e += float_pop()
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, extra
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2314..2318

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

                                                                            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 fscale(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('fscale', float_st0,
                                                                                                                                   float_st1)))
                                                                                e += set_float_cs_eip(instr)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2599..2604

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

                                                                            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

                                                                            def fchs(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('fchs', float_st0)))
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2903..2907
                                                                            miasm/arch/x86/sem.py on lines 2910..2914
                                                                            miasm/arch/x86/sem.py on lines 2917..2921
                                                                            miasm/arch/x86/sem.py on lines 2948..2952
                                                                            miasm/arch/x86/sem.py on lines 2962..2966
                                                                            miasm/arch/x86/sem.py on lines 2969..2973

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

                                                                            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

                                                                            def fsqrt(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('fsqrt', float_st0)))
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2903..2907
                                                                            miasm/arch/x86/sem.py on lines 2910..2914
                                                                            miasm/arch/x86/sem.py on lines 2917..2921
                                                                            miasm/arch/x86/sem.py on lines 2948..2952
                                                                            miasm/arch/x86/sem.py on lines 2955..2959
                                                                            miasm/arch/x86/sem.py on lines 2969..2973

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

                                                                            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

                                                                            def frndint(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('frndint', float_st0)))
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2910..2914
                                                                            miasm/arch/x86/sem.py on lines 2917..2921
                                                                            miasm/arch/x86/sem.py on lines 2948..2952
                                                                            miasm/arch/x86/sem.py on lines 2955..2959
                                                                            miasm/arch/x86/sem.py on lines 2962..2966
                                                                            miasm/arch/x86/sem.py on lines 2969..2973

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

                                                                            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

                                                                            def fsin(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('fsin', float_st0)))
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2903..2907
                                                                            miasm/arch/x86/sem.py on lines 2917..2921
                                                                            miasm/arch/x86/sem.py on lines 2948..2952
                                                                            miasm/arch/x86/sem.py on lines 2955..2959
                                                                            miasm/arch/x86/sem.py on lines 2962..2966
                                                                            miasm/arch/x86/sem.py on lines 2969..2973

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

                                                                            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

                                                                            def fabs(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('fabs', float_st0)))
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2903..2907
                                                                            miasm/arch/x86/sem.py on lines 2910..2914
                                                                            miasm/arch/x86/sem.py on lines 2917..2921
                                                                            miasm/arch/x86/sem.py on lines 2948..2952
                                                                            miasm/arch/x86/sem.py on lines 2955..2959
                                                                            miasm/arch/x86/sem.py on lines 2962..2966

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

                                                                            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

                                                                            def fcos(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('fcos', float_st0)))
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2903..2907
                                                                            miasm/arch/x86/sem.py on lines 2910..2914
                                                                            miasm/arch/x86/sem.py on lines 2948..2952
                                                                            miasm/arch/x86/sem.py on lines 2955..2959
                                                                            miasm/arch/x86/sem.py on lines 2962..2966
                                                                            miasm/arch/x86/sem.py on lines 2969..2973

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

                                                                            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

                                                                            def f2xm1(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_st0, m2_expr.ExprOp('f2xm1', float_st0)))
                                                                                e += set_float_cs_eip(instr)
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 6 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 2903..2907
                                                                            miasm/arch/x86/sem.py on lines 2910..2914
                                                                            miasm/arch/x86/sem.py on lines 2917..2921
                                                                            miasm/arch/x86/sem.py on lines 2955..2959
                                                                            miasm/arch/x86/sem.py on lines 2962..2966
                                                                            miasm/arch/x86/sem.py on lines 2969..2973

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

                                                                            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 setle(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 987..995

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

                                                                            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 setg(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1112..1120

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(of, m2_expr.ExprCond(result[size:size * 2],
                                                                                                                              m2_expr.ExprInt(1, 1),
                                                                                                                              m2_expr.ExprInt(0, 1))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1839..1841

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(cf, m2_expr.ExprCond(result[size:size * 2],
                                                                                                                              m2_expr.ExprInt(1, 1),
                                                                                                                              m2_expr.ExprInt(0, 1))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1836..1838

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

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

                                                                                    value = m2_expr.ExprCond(result - result[:size].signExtend(size * 2),
                                                                                                             m2_expr.ExprInt(1, 1),
                                                                                                             m2_expr.ExprInt(0, 1))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1867..1869
                                                                            miasm/arch/x86/sem.py on lines 1881..1883
                                                                            miasm/arch/x86/sem.py on lines 1885..1887

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def setna(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 976..984
                                                                            miasm/arch/x86/sem.py on lines 998..1006
                                                                            miasm/arch/x86/sem.py on lines 1009..1017
                                                                            miasm/arch/x86/sem.py on lines 1042..1050
                                                                            miasm/arch/x86/sem.py on lines 1134..1142

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

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

                                                                                    value = m2_expr.ExprCond(result - result[:size].signExtend(size * 2),
                                                                                                             m2_expr.ExprInt(1, 1),
                                                                                                             m2_expr.ExprInt(0, 1))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1863..1865
                                                                            miasm/arch/x86/sem.py on lines 1867..1869
                                                                            miasm/arch/x86/sem.py on lines 1885..1887

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def setl(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 998..1006
                                                                            miasm/arch/x86/sem.py on lines 1009..1017
                                                                            miasm/arch/x86/sem.py on lines 1042..1050
                                                                            miasm/arch/x86/sem.py on lines 1123..1131
                                                                            miasm/arch/x86/sem.py on lines 1134..1142

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

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

                                                                                    value = m2_expr.ExprCond(result - result[:size].signExtend(size * 2),
                                                                                                             m2_expr.ExprInt(1, 1),
                                                                                                             m2_expr.ExprInt(0, 1))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1863..1865
                                                                            miasm/arch/x86/sem.py on lines 1867..1869
                                                                            miasm/arch/x86/sem.py on lines 1881..1883

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def setbe(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 976..984
                                                                            miasm/arch/x86/sem.py on lines 998..1006
                                                                            miasm/arch/x86/sem.py on lines 1009..1017
                                                                            miasm/arch/x86/sem.py on lines 1123..1131
                                                                            miasm/arch/x86/sem.py on lines 1134..1142

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def setnbe(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 976..984
                                                                            miasm/arch/x86/sem.py on lines 998..1006
                                                                            miasm/arch/x86/sem.py on lines 1009..1017
                                                                            miasm/arch/x86/sem.py on lines 1042..1050
                                                                            miasm/arch/x86/sem.py on lines 1123..1131

                                                                            Duplicated Code

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

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

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

                                                                            Tuning

                                                                            This issue has a mass of 51.

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def setge(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 976..984
                                                                            miasm/arch/x86/sem.py on lines 1009..1017
                                                                            miasm/arch/x86/sem.py on lines 1042..1050
                                                                            miasm/arch/x86/sem.py on lines 1123..1131
                                                                            miasm/arch/x86/sem.py on lines 1134..1142

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

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

                                                                                    value = m2_expr.ExprCond(result - result[:size].signExtend(size * 2),
                                                                                                             m2_expr.ExprInt(1, 1),
                                                                                                             m2_expr.ExprInt(0, 1))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1863..1865
                                                                            miasm/arch/x86/sem.py on lines 1881..1883
                                                                            miasm/arch/x86/sem.py on lines 1885..1887

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def seta(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 976..984
                                                                            miasm/arch/x86/sem.py on lines 998..1006
                                                                            miasm/arch/x86/sem.py on lines 1042..1050
                                                                            miasm/arch/x86/sem.py on lines 1123..1131
                                                                            miasm/arch/x86/sem.py on lines 1134..1142

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

                                                                            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

                                                                                    mul2 = src[base: base + sizesrc].signExtend(sizedst) * dst[base: base + sizesrc].signExtend(sizedst)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3928..3928

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

                                                                            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

                                                                                    mul1 = src[base: base + sizesrc].signExtend(sizedst) * dst[base: base + sizesrc].signExtend(sizedst)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 3930..3930

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def setnb(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 954..962
                                                                            miasm/arch/x86/sem.py on lines 1020..1028
                                                                            miasm/arch/x86/sem.py on lines 1031..1039
                                                                            miasm/arch/x86/sem.py on lines 1064..1072

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def sets(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 954..962
                                                                            miasm/arch/x86/sem.py on lines 1020..1028
                                                                            miasm/arch/x86/sem.py on lines 1031..1039
                                                                            miasm/arch/x86/sem.py on lines 1160..1168

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def setae(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 954..962
                                                                            miasm/arch/x86/sem.py on lines 1031..1039
                                                                            miasm/arch/x86/sem.py on lines 1064..1072
                                                                            miasm/arch/x86/sem.py on lines 1160..1168

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def sete(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 1020..1028
                                                                            miasm/arch/x86/sem.py on lines 1031..1039
                                                                            miasm/arch/x86/sem.py on lines 1064..1072
                                                                            miasm/arch/x86/sem.py on lines 1160..1168

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def setb(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 2 hrs to fix
                                                                            miasm/arch/x86/sem.py on lines 954..962
                                                                            miasm/arch/x86/sem.py on lines 1020..1028
                                                                            miasm/arch/x86/sem.py on lines 1064..1072
                                                                            miasm/arch/x86/sem.py on lines 1160..1168

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

                                                                            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

                                                                                e.append(
                                                                                    m2_expr.ExprAssign(mRAX[instr.mode],
                                                                                                    m2_expr.ExprOp('x86_cpuid', mRAX[instr.mode], m2_expr.ExprInt(0, instr.mode))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 3471..3473
                                                                            miasm/arch/x86/sem.py on lines 3474..3476
                                                                            miasm/arch/x86/sem.py on lines 3477..3479

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

                                                                            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

                                                                                e.append(
                                                                                    m2_expr.ExprAssign(mRDX[instr.mode],
                                                                                                    m2_expr.ExprOp('x86_cpuid', mRAX[instr.mode], m2_expr.ExprInt(3, instr.mode))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 3468..3470
                                                                            miasm/arch/x86/sem.py on lines 3471..3473
                                                                            miasm/arch/x86/sem.py on lines 3474..3476

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

                                                                            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

                                                                                e.append(
                                                                                    m2_expr.ExprAssign(mRCX[instr.mode],
                                                                                                    m2_expr.ExprOp('x86_cpuid', mRAX[instr.mode], m2_expr.ExprInt(2, instr.mode))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 3468..3470
                                                                            miasm/arch/x86/sem.py on lines 3471..3473
                                                                            miasm/arch/x86/sem.py on lines 3477..3479

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

                                                                            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

                                                                                e.append(
                                                                                    m2_expr.ExprAssign(mRBX[instr.mode],
                                                                                                    m2_expr.ExprOp('x86_cpuid', mRAX[instr.mode], m2_expr.ExprInt(1, instr.mode))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 3468..3470
                                                                            miasm/arch/x86/sem.py on lines 3474..3476
                                                                            miasm/arch/x86/sem.py on lines 3477..3479

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

                                                                            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 movlpd(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst[:64], src[:64]))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4692..4695

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

                                                                            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 movlps(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst[:64], src[:64]))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4686..4689

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

                                                                            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

                                                                                    slices.append(dst[size * i + off: size * i + off + size])
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4561..4561

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

                                                                            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

                                                                                    slices.append(src[size * i + off: size * i + off + size])
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4560..4560

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

                                                                            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

                                                                                ad = ir.ExprMem(
                                                                                    dst.ptr + m2_expr.ExprInt(
                                                                                        (size // 8) * 4,
                                                                                        dst.ptr.size
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 2647..2650
                                                                            miasm/arch/x86/sem.py on lines 2679..2682

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

                                                                            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

                                                                                ad = ir.ExprMem(
                                                                                    dst.ptr + m2_expr.ExprInt(
                                                                                        (size // 8) * 6,
                                                                                        dst.ptr.size
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 2647..2650
                                                                            miasm/arch/x86/sem.py on lines 2663..2666

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

                                                                            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

                                                                                ad = ir.ExprMem(
                                                                                    dst.ptr + m2_expr.ExprInt(
                                                                                        (size // 8) * 1,
                                                                                        dst.ptr.size
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 2663..2666
                                                                            miasm/arch/x86/sem.py on lines 2679..2682

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

                                                                            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

                                                                                ad = ir.ExprMem(
                                                                                    dst.ptr + m2_expr.ExprInt(
                                                                                        (size // 8) * 5,
                                                                                        dst.ptr.size
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 2655..2658

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

                                                                            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

                                                                                ad = ir.ExprMem(
                                                                                    dst.ptr + m2_expr.ExprInt(
                                                                                        (size // 8) * 3,
                                                                                        dst.ptr.size
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 2671..2674

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

                                                                            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

                                                                                c = m2_expr.ExprCond(myecx - m2_expr.ExprInt(1, size=myecx.size),
                                                                                                     m2_expr.ExprInt(1, 1),
                                                                                                     m2_expr.ExprInt(0, 1))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1709..1711

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

                                                                            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

                                                                                c = m2_expr.ExprCond(myecx - m2_expr.ExprInt(1, size=myecx.size),
                                                                                                     m2_expr.ExprInt(1, 1),
                                                                                                     m2_expr.ExprInt(0, 1))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1688..1690

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

                                                                            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

                                                                                    elif expr.op == '!=fu':
                                                                                        to_ext = ~m2_expr.expr_is_float_equal(expr.args[0], expr.args[1])
                                                                                        on_NaN = m2_expr.ExprInt(1, 1)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4035..4037

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

                                                                            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

                                                                                    elif expr.op == '!<fu':
                                                                                        to_ext = ~m2_expr.expr_is_float_lower(expr.args[0], expr.args[1])
                                                                                        on_NaN = m2_expr.ExprInt(1, 1)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4032..4034

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

                                                                            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 andps(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('&', dst, src)))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 3728..3731
                                                                            miasm/arch/x86/sem.py on lines 3734..3737

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

                                                                            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 xorps(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('^', dst, src)))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 3716..3719
                                                                            miasm/arch/x86/sem.py on lines 3728..3731

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

                                                                            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 orps(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, m2_expr.ExprOp('|', dst, src)))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 3716..3719
                                                                            miasm/arch/x86/sem.py on lines 3734..3737

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

                                                                            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 setp(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1075..1083

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

                                                                            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 l_out(_, instr, src1, src2):
                                                                                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/x86/sem.py on lines 3555..3559

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

                                                                            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 seto(_, instr, dst):
                                                                                e = []
                                                                                e.append(
                                                                                    m2_expr.ExprAssign(
                                                                                        dst,
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1086..1094

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

                                                                            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 l_in(_, instr, src1, src2):
                                                                                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/x86/sem.py on lines 3440..3444

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

                                                                            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.size == 64:
                                                                                    bit_l = 3
                                                                                elif dst.size == 128:
                                                                                    bit_l = 4
                                                                                else:
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/os_dep/win_api_x86_32.py on lines 1623..1628

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def update_flag_arith_subwc_co(arg1, arg2, arg3):
                                                                                e = []
                                                                                e += update_flag_subwc_cf(arg1, arg2, arg3)
                                                                                e += update_flag_subwc_of(arg1, arg2, arg3)
                                                                                return e
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 1 hr to fix
                                                                            miasm/arch/aarch64/sem.py on lines 868..872
                                                                            miasm/arch/aarch64/sem.py on lines 886..890
                                                                            miasm/arch/x86/sem.py on lines 243..247
                                                                            miasm/arch/x86/sem.py on lines 250..254
                                                                            miasm/arch/x86/sem.py on lines 259..263

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

                                                                            def update_flag_arith_sub_co(x, y, z):
                                                                                e = []
                                                                                e += update_flag_sub_cf(x, y, z)
                                                                                e += update_flag_sub_of(x, y, z)
                                                                                return e
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 1 hr to fix
                                                                            miasm/arch/aarch64/sem.py on lines 868..872
                                                                            miasm/arch/aarch64/sem.py on lines 886..890
                                                                            miasm/arch/x86/sem.py on lines 243..247
                                                                            miasm/arch/x86/sem.py on lines 259..263
                                                                            miasm/arch/x86/sem.py on lines 266..270

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

                                                                            def update_flag_arith_add_co(x, y, z):
                                                                                e = []
                                                                                e += update_flag_add_cf(x, y, z)
                                                                                e += update_flag_add_of(x, y, z)
                                                                                return e
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 1 hr to fix
                                                                            miasm/arch/aarch64/sem.py on lines 868..872
                                                                            miasm/arch/aarch64/sem.py on lines 886..890
                                                                            miasm/arch/x86/sem.py on lines 250..254
                                                                            miasm/arch/x86/sem.py on lines 259..263
                                                                            miasm/arch/x86/sem.py on lines 266..270

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

                                                                            def update_flag_arith_addwc_co(arg1, arg2, arg3):
                                                                                e = []
                                                                                e += update_flag_addwc_cf(arg1, arg2, arg3)
                                                                                e += update_flag_addwc_of(arg1, arg2, arg3)
                                                                                return e
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 5 other locations - About 1 hr to fix
                                                                            miasm/arch/aarch64/sem.py on lines 868..872
                                                                            miasm/arch/aarch64/sem.py on lines 886..890
                                                                            miasm/arch/x86/sem.py on lines 243..247
                                                                            miasm/arch/x86/sem.py on lines 250..254
                                                                            miasm/arch/x86/sem.py on lines 266..270

                                                                            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 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 l_syscall(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(exception_flags,
                                                                                                         m2_expr.ExprInt(EXCEPT_SYSCALL, 32)))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 1 hr to fix
                                                                            miasm/arch/mips32/sem.py on lines 398..401
                                                                            miasm/arch/x86/sem.py on lines 3399..3403
                                                                            miasm/arch/x86/sem.py on lines 3424..3428

                                                                            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

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

                                                                            def arpl(_, instr, dst, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(exception_flags, m2_expr.ExprInt(1 << 7, 32)))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 3297..3300

                                                                            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

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

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

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

                                                                            def l_sysenter(_, instr):
                                                                                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 3 other locations - About 1 hr to fix
                                                                            miasm/arch/mips32/sem.py on lines 398..401
                                                                            miasm/arch/x86/sem.py on lines 3399..3403
                                                                            miasm/arch/x86/sem.py on lines 3431..3435

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

                                                                            def icebp(_, instr):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(exception_flags,
                                                                                                         m2_expr.ExprInt(EXCEPT_SOFT_BP, 32)))
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 1 hr to fix
                                                                            miasm/arch/mips32/sem.py on lines 398..401
                                                                            miasm/arch/x86/sem.py on lines 3424..3428
                                                                            miasm/arch/x86/sem.py on lines 3431..3435

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

                                                                                    elif expr.op == '<fu':
                                                                                        to_ext = m2_expr.expr_is_float_lower(expr.args[0], expr.args[1])
                                                                                        on_NaN = m2_expr.ExprInt(0, 1)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4022..4024

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

                                                                                    if expr.op == '==fu':
                                                                                        to_ext = m2_expr.expr_is_float_equal(expr.args[0], expr.args[1])
                                                                                        on_NaN = m2_expr.ExprInt(0, 1)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4025..4027

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

                                                                                if ir.do_str_segm:
                                                                                    mss = DS
                                                                                    if instr.additional_info.g2.value:
                                                                                        raise NotImplementedError("add segm support")
                                                                                    addr = ir.gen_segm_expr(mss, addr)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1960..1964

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

                                                                            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 ir.do_str_segm:
                                                                                    mss = ES
                                                                                    if instr.additional_info.g2.value:
                                                                                        raise NotImplementedError("add segm support")
                                                                                    addr = ir.gen_segm_expr(mss, addr)
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1996..2000

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

                                                                            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

                                                                                    next_check_label = check_labels[i + 1] if (i + 1) < len(check_labels) else loc_next_expr
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4977..4977

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

                                                                            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

                                                                                    next_check_label = check_labels[i + 1] if (i + 1) < len(check_labels) else loc_next_expr
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4989..4989

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

                                                                            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

                                                                                return m2_expr.ExprCond(
                                                                                    m2_expr.ExprOp(
                                                                                        m2_expr.TOK_INF_EQUAL_SIGNED,
                                                                                        expr,
                                                                                        test_min_int
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4858..4872

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

                                                                            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

                                                                                    result = m2_expr.ExprOp('*',
                                                                                                            mRAX[instr.mode][:8].zeroExtend(16),
                                                                                                            src1.zeroExtend(16))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1858..1860

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

                                                                            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

                                                                                return m2_expr.ExprCond(
                                                                                    m2_expr.ExprOp(
                                                                                        m2_expr.TOK_INF_EQUAL_SIGNED,
                                                                                        expr,
                                                                                        test_zero
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4825..4839

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

                                                                            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

                                                                                        result = m2_expr.ExprOp('*',
                                                                                                                mRAX[instr.mode][:8].signExtend(16),
                                                                                                                src1.signExtend(16))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1829..1831

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

                                                                            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

                                                                                    m2_expr.ExprCond(m2_expr.expr_is_IEEE754_zero(dst),
                                                                                             locs["Zero"][1],
                                                                                             locs["Denormal"][1],
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 2206..2208

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

                                                                            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

                                                                                             m2_expr.ExprCond(m2_expr.expr_is_infinite(dst),
                                                                                                      locs["Infinity"][1],
                                                                                                      locs["Normal"][1],
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 2200..2202

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

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

                                                                                if isinstance(shifter, m2_expr.ExprInt):
                                                                                    if int(shifter) != 0:
                                                                                        return (e_do, [])
                                                                                    else:
                                                                                        return (e, [])
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 706..710
                                                                            miasm/arch/x86/sem.py on lines 798..802

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

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

                                                                                if isinstance(shifter, m2_expr.ExprInt):
                                                                                    if int(shifter) != 0:
                                                                                        return (e_do, [])
                                                                                    else:
                                                                                        return (e, [])
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 658..662
                                                                            miasm/arch/x86/sem.py on lines 798..802

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

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

                                                                                if isinstance(shifter, m2_expr.ExprInt):
                                                                                    if int(shifter) != 0:
                                                                                        return (e_do, [])
                                                                                    else:
                                                                                        return (e, [])
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 658..662
                                                                            miasm/arch/x86/sem.py on lines 706..710

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

                                                                            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

                                                                                write_labels = [m2_expr.ExprLoc(ir.loc_db.add_location(), ir.IRDst.size)
                                                                                                for _ in range(0, mask.size, 8)]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4967..4968

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

                                                                            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

                                                                                    e.append(m2_expr.ExprAssign(ir.ExprMem(c, size=s).zeroExtend(s),
                                                                                                             meip.zeroExtend(s)))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1436..1437

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

                                                                            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

                                                                                check_labels = [m2_expr.ExprLoc(ir.loc_db.add_location(), ir.IRDst.size)
                                                                                                for _ in range(0, mask.size, 8)]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 4970..4971

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

                                                                            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

                                                                                    e.append(m2_expr.ExprAssign(ir.ExprMem(c, size=s).zeroExtend(s),
                                                                                                             CS.zeroExtend(s)))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 1 hr to fix
                                                                            miasm/arch/x86/sem.py on lines 1440..1441

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

                                                                            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

                                                                                assert (expr.is_op("fmin") or expr.is_op("fmax")) and len(expr.args) == 2
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 55 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 3826..3826

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

                                                                            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 movzx(_, instr, dst, src):
                                                                                e = [m2_expr.ExprAssign(dst, src.zeroExtend(dst.size))]
                                                                                return e, []
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 55 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 447..449

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

                                                                            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 movsx(_, instr, dst, src):
                                                                                e = [m2_expr.ExprAssign(dst, src.signExtend(dst.size))]
                                                                                return e, []
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 55 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 442..444

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

                                                                            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

                                                                                assert (expr.is_op("min") or expr.is_op("max")) and len(expr.args) == 2
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 55 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 3834..3834

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def cld(_, instr):
                                                                                e = [m2_expr.ExprAssign(df, m2_expr.ExprInt(0, df.size))]
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 50 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 841..843
                                                                            miasm/arch/x86/sem.py on lines 846..848
                                                                            miasm/arch/x86/sem.py on lines 856..858
                                                                            miasm/arch/x86/sem.py on lines 861..863

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def std(_, instr):
                                                                                e = [m2_expr.ExprAssign(df, m2_expr.ExprInt(1, df.size))]
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 50 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 841..843
                                                                            miasm/arch/x86/sem.py on lines 846..848
                                                                            miasm/arch/x86/sem.py on lines 851..853
                                                                            miasm/arch/x86/sem.py on lines 861..863

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def stc(_, instr):
                                                                                e = [m2_expr.ExprAssign(cf, m2_expr.ExprInt(1, cf.size))]
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 50 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 841..843
                                                                            miasm/arch/x86/sem.py on lines 851..853
                                                                            miasm/arch/x86/sem.py on lines 856..858
                                                                            miasm/arch/x86/sem.py on lines 861..863

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def cli(_, instr):
                                                                                e = [m2_expr.ExprAssign(i_f, m2_expr.ExprInt(0, i_f.size))]
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 50 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 841..843
                                                                            miasm/arch/x86/sem.py on lines 846..848
                                                                            miasm/arch/x86/sem.py on lines 851..853
                                                                            miasm/arch/x86/sem.py on lines 856..858

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

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def clc(_, instr):
                                                                                e = [m2_expr.ExprAssign(cf, m2_expr.ExprInt(0, cf.size))]
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 4 other locations - About 50 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 846..848
                                                                            miasm/arch/x86/sem.py on lines 851..853
                                                                            miasm/arch/x86/sem.py on lines 856..858
                                                                            miasm/arch/x86/sem.py on lines 861..863

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

                                                                            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

                                                                                return [
                                                                                    m2_expr.ExprAssign(
                                                                                        zf,
                                                                                        m2_expr.ExprCond(
                                                                                            a,
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 50 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 836..837

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

                                                                            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 update_flag_np(result):
                                                                                e = []
                                                                                e += update_flag_nf(result)
                                                                                e += update_flag_pf(result)
                                                                                return e
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 50 mins to fix
                                                                            miasm/arch/aarch64/sem.py on lines 760..764

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

                                                                            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

                                                                                e = [m2_expr.ExprAssign(cf, m2_expr.ExprCond(cf, m2_expr.ExprInt(0, cf.size),
                                                                                                                          m2_expr.ExprInt(1, cf.size)))]
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 50 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 72..78

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

                                                                            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

                                                                                    to_ext = m2_expr.expr_is_NaN(expr.args[0]) | m2_expr.expr_is_NaN(expr.args[1])
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 45 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 4044..4044

                                                                            Duplicated Code

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

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

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

                                                                            Tuning

                                                                            This issue has a mass of 35.

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def fldcw(_, instr, src):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(float_control, src))
                                                                                return e, []
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 45 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 2991..2994

                                                                            Duplicated Code

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

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

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

                                                                            Tuning

                                                                            This issue has a mass of 35.

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                            def fnstcw(_, instr, dst):
                                                                                e = []
                                                                                e.append(m2_expr.ExprAssign(dst, float_control))
                                                                                return e, []
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 45 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 2997..3000

                                                                            Duplicated Code

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

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

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

                                                                            Tuning

                                                                            This issue has a mass of 35.

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                        m2_expr.expr_is_NaN(expr.args[0]) | m2_expr.expr_is_NaN(expr.args[1]),
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 45 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 4018..4018

                                                                            Duplicated Code

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

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

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

                                                                            Tuning

                                                                            This issue has a mass of 35.

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

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

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

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

                                                                            Refactorings

                                                                            Further Reading

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

                                                                                e.append(m2_expr.ExprAssign(ir.IRDst,
                                                                                                         ir.ExprMem(result, size=size).zeroExtend(size)))
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 40 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 1477..1478

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

                                                                            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 rdmsr(ir, instr):
                                                                                e = [m2_expr.ExprAssign(exception_flags,m2_expr.ExprInt(EXCEPT_PRIV_INSN, 32))]
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 40 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 866..868
                                                                            miasm/arch/x86/sem.py on lines 3745..3747

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(ir.IRDst,
                                                                                                         ir.ExprMem(result, size=size).zeroExtend(size)))
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 40 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 1498..1499

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

                                                                            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 sti(_, instr):
                                                                                e = [m2_expr.ExprAssign(exception_flags, m2_expr.ExprInt(EXCEPT_PRIV_INSN, 32))]
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 40 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 3740..3742
                                                                            miasm/arch/x86/sem.py on lines 3745..3747

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

                                                                            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 wrmsr(ir, instr):
                                                                                e = [m2_expr.ExprAssign(exception_flags,m2_expr.ExprInt(EXCEPT_PRIV_INSN, 32))]
                                                                                return e, []
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 2 other locations - About 40 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 866..868
                                                                            miasm/arch/x86/sem.py on lines 3740..3742

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

                                                                            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

                                                                                mn_dst = m2_expr.ExprCond(cond,
                                                                                                          dstA.zeroExtend(ir.IRDst.size),
                                                                                                          dstB.zeroExtend(ir.IRDst.size))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 1671..1673
                                                                            miasm/arch/x86/sem.py on lines 1694..1696
                                                                            miasm/arch/x86/sem.py on lines 1714..1716

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

                                                                            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

                                                                                dst_o = m2_expr.ExprCond(c,
                                                                                                         dst.zeroExtend(ir.IRDst.size),
                                                                                                         n.zeroExtend(ir.IRDst.size))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 363..365
                                                                            miasm/arch/x86/sem.py on lines 1694..1696
                                                                            miasm/arch/x86/sem.py on lines 1714..1716

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

                                                                            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

                                                                                dst_o = m2_expr.ExprCond(c,
                                                                                                         dst.zeroExtend(ir.IRDst.size),
                                                                                                         n.zeroExtend(ir.IRDst.size))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 363..365
                                                                            miasm/arch/x86/sem.py on lines 1671..1673
                                                                            miasm/arch/x86/sem.py on lines 1694..1696

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

                                                                            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

                                                                                dst_o = m2_expr.ExprCond(c,
                                                                                                         dst.zeroExtend(ir.IRDst.size),
                                                                                                         n.zeroExtend(ir.IRDst.size))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 363..365
                                                                            miasm/arch/x86/sem.py on lines 1671..1673
                                                                            miasm/arch/x86/sem.py on lines 1714..1716

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

                                                                            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

                                                                                    new_extra_ir = [irblock.modify_exprs(mod_src=lambda expr: expr.replace_expr(fix_next_loc))
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 35 mins to fix
                                                                            miasm/arch/mips32/sem.py on lines 648..648

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

                                                                            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 jcxz(ir, instr, dst):
                                                                                return gen_jcc(ir, instr, mRCX[instr.mode][:16], dst, False)
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 1581..1582

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

                                                                            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

                                                                                e += [m2_expr.ExprAssign(nf, m2_expr.ExprOp("FLAG_SIGN_SUB", result, m2_expr.ExprInt(0, result.size)))]
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 604..604

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

                                                                            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

                                                                                out.append(dst[64:] if control & 1 else dst[:64])
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 5091..5091

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

                                                                            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

                                                                                out.append(src[64:] if control & 2 else src[:64])
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 5090..5090

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

                                                                            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

                                                                                e += [m2_expr.ExprAssign(zf, m2_expr.ExprOp('FLAG_EQ_CMP', result, m2_expr.ExprInt(0, result.size)))]
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 605..605

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

                                                                            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 jecxz(ir, instr, dst):
                                                                                return gen_jcc(ir, instr, mRCX[instr.mode][:32], dst, False)
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 35 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 1577..1578

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(float_c2,
                                                                                                         m2_expr.ExprOp('fcom_c2', dst,
                                                                                                                        src.zeroExtend(dst.size))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 2258..2260
                                                                            miasm/arch/x86/sem.py on lines 2261..2263
                                                                            miasm/arch/x86/sem.py on lines 2267..2269

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

                                                                            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 update_flag_subwc_of(op1, op2, op3):
                                                                                "Compute of in @res = @op1 + @op2 + @op3"
                                                                                return [m2_expr.ExprAssign(of, m2_expr.ExprOp("FLAG_SUBWC_OF", op1, op2, op3))]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 220..222
                                                                            miasm/arch/x86/sem.py on lines 225..227
                                                                            miasm/arch/x86/sem.py on lines 231..233

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(float_c0,
                                                                                                         m2_expr.ExprOp('fcom_c0', dst,
                                                                                                                        src.zeroExtend(dst.size))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 2261..2263
                                                                            miasm/arch/x86/sem.py on lines 2264..2266
                                                                            miasm/arch/x86/sem.py on lines 2267..2269

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(meip, ir.ExprMem(
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 1475..1475

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

                                                                            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 update_flag_addwc_of(op1, op2, op3):
                                                                                "Compute of in @res = @op1 + @op2 + @op3"
                                                                                return [m2_expr.ExprAssign(of, m2_expr.ExprOp("FLAG_ADDWC_OF", op1, op2, op3))]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 220..222
                                                                            miasm/arch/x86/sem.py on lines 231..233
                                                                            miasm/arch/x86/sem.py on lines 236..238

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(float_c1,
                                                                                                         m2_expr.ExprOp('fcom_c1', dst,
                                                                                                                        src.zeroExtend(dst.size))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 2258..2260
                                                                            miasm/arch/x86/sem.py on lines 2264..2266
                                                                            miasm/arch/x86/sem.py on lines 2267..2269

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(float_c3,
                                                                                                         m2_expr.ExprOp('fcom_c3', dst,
                                                                                                                        src.zeroExtend(dst.size))))
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 2258..2260
                                                                            miasm/arch/x86/sem.py on lines 2261..2263
                                                                            miasm/arch/x86/sem.py on lines 2264..2266

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

                                                                            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 update_flag_addwc_cf(op1, op2, op3):
                                                                                "Compute cf in @res = @op1 + @op2 + @op3"
                                                                                return [m2_expr.ExprAssign(cf, m2_expr.ExprOp("FLAG_ADDWC_CF", op1, op2, op3))]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 225..227
                                                                            miasm/arch/x86/sem.py on lines 231..233
                                                                            miasm/arch/x86/sem.py on lines 236..238

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

                                                                            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 update_flag_subwc_cf(op1, op2, op3):
                                                                                "Compute cf in @res = @op1 + @op2 + @op3"
                                                                                return [m2_expr.ExprAssign(cf, m2_expr.ExprOp("FLAG_SUBWC_CF", op1, op2, op3))]
                                                                            Severity: Major
                                                                            Found in miasm/arch/x86/sem.py and 3 other locations - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 220..222
                                                                            miasm/arch/x86/sem.py on lines 225..227
                                                                            miasm/arch/x86/sem.py on lines 236..238

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

                                                                            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

                                                                                e.append(m2_expr.ExprAssign(meip, ir.ExprMem(
                                                                            Severity: Minor
                                                                            Found in miasm/arch/x86/sem.py and 1 other location - About 30 mins to fix
                                                                            miasm/arch/x86/sem.py on lines 1496..1496

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

                                                                            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

                                                                            There are no issues that match your filters.

                                                                            Category
                                                                            Status