A flyweight change pattern extractor and change recommender
$ git clone https://github.com/salab/phph.git
$ cd phph
$ ./gradlew shadowJar
$ java -jar build/libs/phph-all.jar <cmd> [options...]
$ java -jar phph-all.jar init # initalize database
$ java -jar phph-all.jar extract --repository=/path/to/repo/.git # extract patterns
$ java -jar phph-all.jar find # find pattern application opportinuties
$ java -jar phph-all.jar measure # compute metric values
$ java -jar phph-all.jar browse # view patterns at localhost:8080
--log=<level>: Specify log level; either ofERROR,WARN,INFO,DEBUG,TRACE(Default:INFO)-q,--quiet: quiet mode (same as--log=ERROR)-v,--verbose: verbose mode (same as--log=DEBUG)--help: Show the help message and exit--version: print version information and exit-f,--database: Specifies database file path (Default:phph.db)
init is for initializing the phph database.
phph uses SQLite as its databse backend.
This command creates an SQLite database file (default: "phph.db" at the current directory).
$ java -jar phph-all.jar init
$ java -jar phph-all.jar --database=path/to/database.db init # Use a different path for the database
extract extracts changes from Git repositories.
$ java -jar phph-all.jar extract --repository=path/to/repo/.git
Options:
-p,--parallel=<nthreads>: Parallel processing. The number of threads () to use in parallel can be specified. If<nthreads>is omitted, the total number of processors - 1 is used.--from=<rev>: Revision to skip go further (exclusive).--end=<rev>: Revision to start traversing (default:HEAD)--differencer=<type>: Specify the differencer used; either ofmyersorhistogram(Default:myers)--splitter=<type>: Specify the splitter used; either ofplain,mpa,nitron(Default:mpa)--non-essential: Use non-essential statements--min-size: Minimum chunk size (default:0)--max-size: Maximum chunk size (default:Integer.MAX_VALUE)
find finds pattern application opportinuties
measure computes metric values
browse provides a view of patterns at localhost:8080
This tool is inspired by MPAnalyzer/Ammonia, and its basic design is based on them.
phph is an abbreviation of Phenolphthalein.