File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed
src/Famix-Python-Entities Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -33,3 +33,13 @@ FamixPythonModel class >> importingContextClass [
3333 < generated>
3434 ^ FamixPythonImportingContext
3535]
36+
37+ { #category : ' replication' }
38+ FamixPythonModel >> defaultDetectionConfiguration [
39+
40+ ^ FamixRepConfiguration
41+ sourcesCleaner: FamixRepPythonCleaner new
42+ minimumNumberOfReplicas: 2
43+ ofLines: 10
44+ ofCharacters: 80
45+ ]
Original file line number Diff line number Diff line change 1+ "
2+ I am a cleaner used by FamixReplication to detect duplicated code in Python code
3+ "
4+ Class {
5+ #name : ' FamixRepPythonCleaner' ,
6+ #superclass : ' FamixRepPairedCommentsCleaner' ,
7+ #category : ' Famix-Python-Entities-Replication' ,
8+ #package : ' Famix-Python-Entities' ,
9+ #tag : ' Replication'
10+ }
11+
12+ { #category : ' accessing' }
13+ FamixRepPythonCleaner class >> description [
14+
15+ ^ ' Clearner for Python language'
16+ ]
17+
18+ { #category : ' displaying' }
19+ FamixRepPythonCleaner class >> displayStringOn: aStream [
20+
21+ aStream << ' Python comments'
22+ ]
23+
24+ { #category : ' private' }
25+ FamixRepPythonCleaner >> cleanLine: aText [
26+ " a++ //asd -> a++"
27+
28+ ^ (super cleanLine: aText) copyUpToSubString: ' //'
29+ ]
30+
31+ { #category : ' private' }
32+ FamixRepPythonCleaner >> isComment: aLine [
33+ " we could have defined this method
34+ but just returning false because a comment line will be empty because cleaner removes everything within double qoutes and hence not considered by the detector"
35+
36+ ^ false
37+ ]
38+
39+ { #category : ' actions' }
40+ FamixRepPythonCleaner >> multilineCommentCloser [
41+
42+ ^ ' """'
43+ ]
44+
45+ { #category : ' actions' }
46+ FamixRepPythonCleaner >> multilineCommentOpener [
47+
48+ ^ ' """'
49+ ]
You can’t perform that action at this time.
0 commit comments