2.2.2 • Published 7 months ago

git-metrics v2.2.2

Weekly downloads
-
License
ISC
Repository
github
Last release
7 months ago

git-metrics

git-metrics is set of apps used to work with git repos and calculate different measures on git repos.

run git-metrics apps

The apps can be launched with the command

npx git-metrics <app-name> <params>

or, if we have cloned git-metrics repo, from the git-metrics repo folder launching the command

node ./dist/lib/command.js <app-name> <params>

Executing npx git-metrics prints on the console the list of available apps.

Executing npx git-metrics <app-name> -h prints on the console the help for the specific app.

apps available

  • code-turnover: calculates the code-turnover on the repos contained in a folder and save it to csv files - code-turnover is a measure of the effort spent to develop and maintain a codebase in a certain time window
  • cloc-diff-between-dates: calculates the differences in the lines of code/comments/blanks between two dates in a set of repos contained in a folder
  • read-repos-commits: reads all the commit records of a set of repos and save them on csv files - the result can be used to have an high level idea of how intense is the work on a certain codebase
  • cloc-byfile-multi-repos: calculates the lines of code/comments/blanks on all the files in all the repos contained in a certain folder using the cloc command which, by default, works on a single repo
  • fetch-repos: fetches the git repos contained in a folder and its subfolders
  • pull-repos: pulls the git repos contained in a folder and its subfolders

apps deprecated

  • cloc-monthly-diff-repos: calculates statistics about the changes that occurred on a codebase on a monthly basis, i.e. calculating the differences in the codebase between the last commit of a month and the last commit of the previous month - use code-turnover instead to have the real picture of the changes in a period of time
  • reports: there are different reports that can be run on repos to gather statistics about, for instance, the files that have changed most in a certain period of time, the authors that have contributed more and so on - code-turnover instead and then build the desired pivots using the data generated

libraries

The apps use git and cloc commands to calculate their statistics.

Such commands are wrapped in functions provided by different libraries

  • cloc-functions: wraps the cloc to provide different output, e.g. a dictionary of the files in a repo with the information about their lines of code or the differences, in terms lines of code/comment/blank added/deleted/renamed in a certain period of time
  • git-functions: wraps different git commands, such as git log or git diff to provide different output, e.g. the list of all commits in a certain period of time or the differences between the files comparing two different commits
  • git-cloc-functions: combines git and cloc commands to provide a more comprehensive set of information about the changes that have occurred in a repo in certain period of time

use of rxJs

git-metrics uses extensively the rxJs library.

The reason is that the git and cloc commands are often executed asynchronously using the node child-process functions in their 'callback based' form (i.e. exec and spawn).

The child-process 'callback based' functions are turned into rsJs Observables using functions provided in execute-command.

Converting 'callback based' functions into Observable streams allows to conveniently manipulate such streams via rxJs operators.

2.2.1

7 months ago

2.2.2

7 months ago

2.1.2

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.9

2 years ago

1.1.10

2 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.1

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.39

4 years ago

1.0.17

4 years ago

1.0.38

4 years ago

1.0.16

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.40

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.37

4 years ago

1.0.15

4 years ago

1.0.36

4 years ago

1.0.14

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago