-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMain.hs
More file actions
84 lines (66 loc) · 1.97 KB
/
Main.hs
File metadata and controls
84 lines (66 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
module Main where
import System.FilePath
import Data.Time
import Control.Monad
import Utils
import Tracking
import Settings
import Processing.CodeFiles
import Processing.Extract
import Processing.PMD
import Processing.CPD
import Reporting.Blackbox
import Reporting.Reports
-------------------------------------------------------------------------------
-- Settings
mySettings:: Settings
mySettings = Settings {
blackboxDB = "<dir>//<file>.db"
, binDataDir = "<dir>"
, locDir = "<dir>//cloc"
, locOutDir = "<dir>"
, pmdSettings = myPMDSettings
, cpdSettings = myCPDSettings
}
myPMDSettings = PMDSettings {
pmdRuleSets = undefined
, pmdFormat = "csv"
, pmdRuleNames = undefined
, pmdSaveFile = True
, pmdDir = "<dir>//pmd-bin-5.5.2//lib"
, pmdOutDir = "<dir>"
}
myCPDSettings = CPDSettings {
cpdOutDir = "<dir>"
, cpdMinTokens = cpdDefaultMinTokens
, cpdDir = "<dir>"
}
sett :: Settings
sett = mySettings
-------------------------------------------------------------------------------
-- Main
main = myMain sett
myMain :: Settings -> IO ()
myMain sett = do
t1 <- getCurrentTime
-- Testing
--testExtract1
--testPMD
--testCPD
-- * Issue selection
--issueSelection "<dir>" sett
--issueSelectionCPD "<dir>" sett
--freqAnalysis "<dir>//<file>.csv"
-- * end issue selection
getCurrentTime >>= printElapsedTime t1
-- | Initial issue selection
-- Assumes java code files are extracted into the exFp folder
-- [Elapsed time 5631s]
issueSelection :: FilePath -> Settings -> IO ()
issueSelection exFp sett = void $ runPMD (pmdSettings sett) { pmdRuleSets = selPmdRules } exFp
-- | Initial CPD
-- Assumes java code files are extracted into the exFp folder
issueSelectionCPD :: FilePath -> Settings -> IO ()
issueSelectionCPD exFp sett = runCPD' 50 >>= processCPDFile
where
runCPD' max = runCPD (cpdSettings sett) { cpdMinTokens = max } exFp