The Python Design Defect Detector(DDD) is a program that parses Python source code from versions 2 and 3. The program contains detection method for finding code smells.
- ANTLR libraries (included)
- Java 1.8
- Java IDE (used Eclipse)
The Python Design Defect Detector (DDD) requires no installation just compilation through a Java IDE.
DDD takes four settings files.
- config.properties
- maps.properites
- suspects.properties
- metrics.properties
The primary config file needs to have the following properties set to make the parser and scraper work.
locations.log.error=scraper/logs
locations.log.out=scraper/logs
locations.data.input=scraper/input
locations.data.input.disklocations=scraper/git-locations.csv
locations.data.input.filter=scraper/filtered-projects.txt
locations.data.output=scraper/temp
locations.data.results=scraper/results
locations.githubgapitoken=scraper/token.txt
The Python DDD contains three sub-systems.
Parses python v2 and v3 code and can see if code is likely to contain code smells.
Scraper for gathering GitHub links from PyPi. The scraper gathers links from PyPi and parses the HTML to find GitHub links to repositories.
Requires a valid GitHub API key. Due to the API rate limit about 2500 projects can be processed per hour.
Issue miner code is included but untested.
The DDD works in multiple stages.
- Setup
- Creating log files
- Creating files for storing temp data
- Creating files for results
- Registration of detector modules
- Building AST
- Building Symantic model
- Visiting tree for data collection
- Checking data with detectors
- Storing results