cea-sec/miasm

View on GitHub

Showing 1,373 of 3,017 total issues

File arch.py has 1056 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Toshiba MeP-c4 - miasm architecture definition
# Guillaume Valadon <guillaume@valadon.net>

from builtins import range
from miasm.core.cpu import *
Severity: Major
Found in miasm/arch/mep/arch.py - About 2 days to fix

    Function parse_txt has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_txt(mnemo, attrib, txt, loc_db):
        """Parse an assembly listing. Returns an AsmCfg instance
    
        @mnemo: architecture used
        @attrib: architecture attribute
    Severity: Minor
    Found in miasm/core/parse_asm.py - About 2 days 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

    File symbexec.py has 913 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    from __future__ import print_function
    from builtins import range
    import logging
    try:
        from collections.abc import MutableMapping
    Severity: Major
    Found in miasm/ir/symbexec.py - About 2 days to fix

      Function from_ExprOp has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
      Open

          def from_ExprOp(self, expr):
              if len(expr.args) == 1:
                  if expr.op == 'parity':
                      arg = expr.args[0]
                      out = self.from_expr(arg)
      Severity: Minor
      Found in miasm/ir/translators/C.py - About 2 days 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

      File graph.py has 864 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      from collections import defaultdict, namedtuple
      
      from future.utils import viewitems, viewvalues
      import re
      
      
      Severity: Major
      Found in miasm/core/graph.py - About 2 days to fix

        File ir.py has 843 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #-*- coding:utf-8 -*-
        
        #
        # Copyright (C) 2013 Fabrice Desclaux
        #
        Severity: Major
        Found in miasm/ir/ir.py - About 2 days to fix

          Function eval_assignblock has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
          Open

              def eval_assignblock(self, assignblock):
                  """
                  Evaluate the @assignblock on the current state
                  @assignblock: AssignBlock instance
                  """
          Severity: Minor
          Found in miasm/analysis/data_flow.py - About 1 day 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

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

          from __future__ import print_function
          from builtins import range
          
          import miasm.expression.expression as expr
          from miasm.ir.ir import AssignBlock, Lifter, IRBlock
          Severity: Major
          Found in miasm/arch/ppc/sem.py - About 1 day to fix

            File arch.py has 789 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #-*- coding:utf-8 -*-
            
            from __future__ import print_function
            from builtins import range
            
            
            Severity: Major
            Found in miasm/arch/sh4/arch.py - About 1 day to fix

              File sandbox.py has 772 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              from __future__ import print_function
              from builtins import range
              
              import os
              import logging
              Severity: Major
              Found in miasm/analysis/sandbox.py - About 1 day to fix

                File environment.py has 745 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                from __future__ import print_function
                from collections import namedtuple
                import functools
                import logging
                import os
                Severity: Major
                Found in miasm/os_dep/linux/environment.py - About 1 day to fix

                  File syscall.py has 739 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  from builtins import range
                  import fcntl
                  import functools
                  import logging
                  import struct
                  Severity: Major
                  Found in miasm/os_dep/linux/syscall.py - About 1 day to fix

                    Function add_block has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def add_block(self, asmblock):
                            """Create a python function corresponding to an AsmBlock
                            @asmblock: AsmBlock
                            """
                    
                    
                    Severity: Minor
                    Found in miasm/jitter/jitcore_python.py - About 1 day 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 kernel32_CreateFile has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def kernel32_CreateFile(jitter, funcname, get_str):
                        ret_ad, args = jitter.func_args_stdcall(["lpfilename", "access",
                                                                 "dwsharedmode",
                                                                 "lpsecurityattr",
                                                                 "dwcreationdisposition",
                    Severity: Minor
                    Found in miasm/os_dep/win_api_x86_32.py - About 1 day 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

                    File arch.py has 676 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    from builtins import range
                    
                    import logging
                    from pyparsing import *
                    from miasm.expression.expression import *
                    Severity: Major
                    Found in miasm/arch/ppc/arch.py - About 1 day to fix

                      Function match_expr has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def match_expr(expr, pattern, tks, result=None):
                          """Try to match the @pattern expression with the pattern @expr with @tks jokers.
                          Result is output dictionary with matching joker values.
                          @expr : Expr pattern
                          @pattern : Targeted Expr to match
                      Severity: Minor
                      Found in miasm/expression/expression.py - About 1 day 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

                      File elf_init.py has 670 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      #! /usr/bin/env python
                      
                      from __future__ import print_function
                      from builtins import range
                      import logging
                      Severity: Major
                      Found in miasm/loader/elf_init.py - About 1 day to fix

                        File arch.py has 663 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        #-*- coding:utf-8 -*-
                        
                        import logging
                        from collections import defaultdict
                        
                        
                        Severity: Major
                        Found in miasm/arch/mips32/arch.py - About 1 day to fix

                          File pe.py has 643 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          from builtins import map
                          import os
                          import struct
                          import logging
                          from collections import defaultdict
                          Severity: Major
                          Found in miasm/jitter/loader/pe.py - About 1 day to fix

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

                            # Toshiba MeP-c4 - miasm instructions side effects
                            # Guillaume Valadon <guillaume@valadon.net>
                            
                            from miasm.core.sembuilder import SemBuilder
                            from miasm.ir.ir import Lifter
                            Severity: Major
                            Found in miasm/arch/mep/sem.py - About 1 day to fix
                              Severity
                              Category
                              Status
                              Source
                              Language