Skip to content

Commit e446d97

Browse files
committed
Fix few codacy issues
1 parent 1476255 commit e446d97

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
import ida_gdl
21
import ida_funcs
3-
import ida_lines
2+
import ida_bytes
43
import idautils
54

65
from . import annotation
76

87

98
class CommentAnnotation(annotation.Annotation):
10-
@staticmethod
11-
def data(offset):
12-
func = ida_funcs.get_func(offset)
9+
def data(self):
10+
func = ida_funcs.get_func(self.offset)
1311

14-
comments = {ea - offset: self.get_comment(ea)
12+
comments = {ea - self.offset: self.get_comment(ea)
1513
for ea in idautils.Heads(func.startEA, func.endEA)}
1614
return comments
1715

18-
@staticmethod
1916
def get_comment(self, ea):
2017
raise NotImplementedError("get_comment method not implemented")
2118

2219

23-
def RegularCommentAnnotation(CommentAnnotation):
20+
class RegularCommentAnnotation(CommentAnnotation):
2421
@staticmethod
2522
def get_comment(ea):
2623
return ida_bytes.get_cmt(ea, 0)

idaplugin/rematch/collectors/annotations/positional_annotation.py idaplugin/rematch/collectors/annotations/positional.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def node_contained(node):
3535
for succ in node.succs()
3636
if succ.id in node_ids]
3737
serialized_node = {'id': node.id, 'start': node.startEA,
38-
'end': node.endEA,'successive': successive_nodes,
38+
'end': node.endEA, 'successive': successive_nodes,
3939
'assembly': assembly}
4040
nodes_data.append(serialized_node)
4141

idaplugin/rematch/instances/function.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, *args, **kwargs):
2323
collectors.vectors.MnemonicHashVector,
2424
collectors.vectors.MnemonicHistVector,
2525
collectors.vectors.BasicBlockSizeHistVector}
26-
self.annotations |= {collectors.annotations.AssemblyAnnotation}
26+
self.annotations |= {collectors.annotations.AssemblyAnnotation,
2727
collectors.annotations.PositionalAnnotation,
2828
collectors.annotations.RegularCommentAnnotation}
2929

0 commit comments

Comments
 (0)