New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lizard-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lizard-wrapper

A Node.js wrapper for Lizard, a code complexity analyser.

latest
Source
npmnpm
Version
0.1.9
Version published
Maintainers
1
Created
Source

Lizard wrapper

A Node.js wrapper for Lizard, a code complexity analyser.

Requirements

  • Node.js
  • Python
  • Lizard
pip install lizard

Installation

npm install lizard-wrapper

Usage

Sample code

const lizard = require('lizard-wrapper');

var result = lizard.analyzeFile('fizzbuzz.cpp');
var s = JSON.stringify(result);
console.log(s);

You can also use source code string instead of file.

var result = lizard.analyzeSourceCode('foo.cpp', 'int foo(){}');

Sample output

{"filename":"fizzbuzz.cpp","nloc":15,"function_list":[{"cyclomatic_complexity":6,"nloc":13,"token_co
unt":89,"name":"main","long_name":"main()","start_line":3,"end_line":15,"parameters":[],"filename":"
fizzbuzz.cpp","top_nesting_level":0,"length":13,"fan_in":0,"fan_out":0,"general_fan_out":0}],"token_
count":96}

Licence

MIT License

Keywords

metric

FAQs

Package last updated on 30 Sep 2017

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