Skip to content

grammarhoard/2015-vavrova-2020-barten-smells-python

 
 

Repository files navigation

Python Design Defect Detector

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.

Requirements

  • ANTLR libraries (included)
  • Java 1.8
  • Java IDE (used Eclipse)

Installing

The Python Design Defect Detector (DDD) requires no installation just compilation through a Java IDE.

Configuration

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

Subsystems

The Python DDD contains three sub-systems.

Parser

Parses python v2 and v3 code and can see if code is likely to contain code smells.

Scraper

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.

Miner

Issue miner code is included but untested.

How does it work?

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Java 82.9%
  • ANTLR 14.6%
  • Python 2.5%