New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cmetrix

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cmetrix

CLI to build code metrics charts for your projects

  • 1.2.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
decreased by-55.56%
Maintainers
1
Weekly downloads
 
Created
Source

cmetrix

Build Status npm version code style: prettier

CLI to build code metrics charts for your projects

Purpose

Your team is working on several projects. Each project is composed of several repositories. You would like to have an overview of the amazing work that has been done.

Run cmetrix and you will get beautiful charts (thanks to cloc and apexcharts used under the hood)

Installation

  • Install NodeJS
  • Install cloc
  • Then run npx cmetrix --help

Usage

First, you have to describe your projects in a JSON configuration file. Then, just run npx cmetrix charts -c <configuration-file>.json

(npx cmetrix charts --help for more options)

Configuration file

A simple JSON configuration file example is available in the ./examples directory. You can add languages and excludeDirs to have a better repository analysis.

{
  projects: [
    {
      name: 'project 1',
      repositories: [
        { name: 'lodash' },
        { name: 'shelljs' },
        { name: 'pelican' },
      ],
    },
    {
      name: 'project 2',
      repositories: [{ name: 'lodash' }, { name: 'quart' }],
    },
  ],
  repositories: [
    {
      name: 'lodash',
      url: 'git@github.com:lodash/lodash.git',
      excludeDirs: ['node_modules'], // <- you can exclude dirs from analysis
      tag: '3.10.1', // <- you can checkout a given tag
    },
    {
      name: 'shelljs',
      url: 'https://github.com/shelljs/shelljs.git',
      languages: ['JavaScript', 'TypeScript'], // <- you can filter on languages
    },
    { name: 'quart', url: 'https://gitlab.com/pgjones/quart.git' },
    { name: 'pelican', url: 'https://github.com/getpelican/pelican.git' },
  ],
}

Authentication

You can pass authentication tokens to cmetrix when accessing private repositories through https:// using the following environment variables: CMETRIX_GITHUB_TOKEN, CMETRIX_GITLAB_TOKEN, CMETRIX_BITBUCKET_TOKEN.

⚠️ Do not fill your configuration file with tokens: cmetrix will do the job for you.

Example if you have private repos in github and gitlab: CMETRIX_GITHUB_TOKEN=aabbccddaabbccdd CMETRIX_GITLAB_TOKEN=1122334455 npx cmetrix charts -c <configuration-file>.json

Development

  npm run build
  npm start -- charts --help

Note: you can run the example: npm run build && npm start -- charts -c examples/conf.json --open

Keywords

FAQs

Package last updated on 03 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc