Showing 85 of 1,244 total issues
File AnalyzeIt.rb
has 1196 lines of code (exceeds 250 allowed). Consider refactoring. Open
require './metasm/metasm'
include Metasm
require 'pp'
require 'date'
File sample.py
has 868 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This file is part of Polichombr.
(c) 2017 ANSSI-FR
Method getArg
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
def self.getArg(addrori, arg)
di = $gdasm.di_at(addrori)
return nil unless defined?(di.opcode)
carg = 0
- Read upRead up
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
Method checkCall
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
def checkCall(strFunc, xrefCall)
basefunc = MetasmUtils.find_start_of_function(xrefCall)
unless basefunc.nil?
log('')
log("Top of function : #{PoliUtils.poliLinkAddr(basefunc)} ; Top of block : #{PoliUtils.poliLinkAddr($gdasm.di_at(xrefCall).block.list[0].address)}")
- Read upRead up
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
SampleController
has 56 functions (exceeds 20 allowed). Consider refactoring. Open
class SampleController(object):
"""
Wrapper to the Sample model. It is in charge of managing the creation,
extraction and modification of samples, and all of directly related
File family.py
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This file is part of Polichombr.
(c) 2018 ANSSI-FR
File connection.py
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Skelenox: the collaborative IDA Pro Agent
This file is part of Polichombr
(c) ANSSI-FR 2018
Method calculate_machoc_hash
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def self.calculate_machoc_hash(dasm)
@fullFuncSign = ''
@fullHashSign = ''
@listoffunct = []
dasm.function.each do |addr, _symb|
- Read upRead up
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
Method checkCall
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
def checkCall(strFunc, xrefCall)
basefunc = MetasmUtils.find_start_of_function(xrefCall)
unless basefunc.nil?
log('')
log("Top of function : #{PoliUtils.poliLinkAddr(basefunc)} ; Top of block : #{PoliUtils.poliLinkAddr($gdasm.di_at(xrefCall).block.list[0].address)}")
Method printSubCallTree
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def printSubCallTree(fromaddr, toaddr, indent, cnt)
return if fromaddr == toaddr
i = 0
space1 = ''
indent.each do |_id, iscontinue|
- Read upRead up
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
FamilyController
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class FamilyController(object):
"""
Family object controller.
"""
Method find_start_of_function
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def self.find_start_of_function(address)
blocks = []
di = $gdasm.di_at(address)
return nil unless defined?(di.instruction)
return nil unless defined?(di.block)
- Read upRead up
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 sample.py
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This file is part of Polichombr.
(c) 2016 ANSSI-FR
File api_idaactions.py
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This file is part of Polichombr.
(c) 2018 ANSSI-FR
Function execute_task
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def execute_task(mqueue, kill_event):
"""
Simple worker wich will execute the tasks analyses. It ends on setting the
analysis status as finished.
"""
- Read upRead up
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 set_tlp_level
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def set_tlp_level(self, family, tlp_level, no_propagation=False):
"""
Change TLP level. Propagates to other items.
"""
if family.parents:
- Read upRead up
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
Method getArg
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.getArg(addrori, arg)
di = $gdasm.di_at(addrori)
return nil unless defined?(di.opcode)
carg = 0
File forms.py
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This file is part of Polichombr.
(c) 2018 ANSSI-FR
SkelIDBHook
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class SkelIDBHook(ida_idp.IDB_Hooks):
"""
IDB hooks, subclassed from ida_idp.py
"""
skel_conn = None
Method is_linked_block
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.is_linked_block(di, start_address)
result = false
@loopcount += 1
return false if @loopcount > 500
return result unless defined?(di.block)
- Read upRead up
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"