Skip to content

cpsc410/GithubAnalysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GithubAnalysis

Generate the encoded statements from GitHub commit analysis. Returns a list of JSON objects that looks like the following:

[{ fileName: 'cpsc410_ctrl_alt_elite/src/mainrun/OpenCvTest.java',
    contributors: Map { 'Ben' => 50, 'Cyrielle' => 50 },
    topContributors: [ 'Ben', 'Cyrielle' ] },
    
  { fileName: 'cpsc410_ctrl_alt_elite/src/mainrun/Main.java',
    contributors: Map { 'Ben' => 11, 'Ceylin' => 15, 'Cyrielle' => 33, 'q6y0b' => 1 },
    topContributors: [ 'Cyrielle', 'Ceylin', 'Ben', 'q6y0b' ] },
    
  { fileName: 'cpsc410_ctrl_alt_elite/src/libs/Node.java',
    contributors: Map { 'Ceylin' => 1, 'Cyrielle' => 22 },
    topContributors: [ 'Cyrielle', 'Ceylin' ] },
    
  { fileName: 'cpsc410_ctrl_alt_elite/src/libs/NameCheckException.java',
    contributors: Map { 'Ben' => 1, 'Ceylin' => 7 },
    topContributors: [ 'Ceylin', 'Ben' ] }]

Usage:

1. Clone a GitHub repo you'd like to analyze.

2. Copy the gitStats.sh script into the clones repo.

3. Run the shell script.

  • ./gitStatsAll.sh
  • this will output the extracted commit stats into a text file (stats.txt) into the current repo the shell ran from

4. Take the outputted txt file and copy it into resources/valid/input.txt

5. Compile the TypeScript

tsc main.ts

6. Main can take in several command line argument in order to customize the analysis.

 Usage
    $ ./main <input>

	Options
	  --languageSpec, -l  Choose language to view
	  --commitCont, -c Choose the number of top committers
	  --netEffect, -n Choose from: "added", "deleted" or "sum"
	  --fileCont, -f Choose the number of top contributors per file

An example of its usage would look as follows:

./main.js --l java --c 13 --n sum --f 7
./main.js --l all --c 5 --n added --f 3
//with no specified arguments the call will default to:
./main.js all 10 added 10

To see all of these instructions in terminal running

./main --help

will show all its usage.

7. The program will output and save a JSON file to resources/output

  • the program returns the list of JSON files generated by analysing the stats, which then could be used as the input to the backend of the Viz project

About

Generating the encoded statements from GitHub commit analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •