@lx-frontend/node-complexity

1.1.1 • Public • Published

@lx-frontend/lx-complexity

用于计算项目中函数的圈复杂度

Usage

const lxComplexity = require('@lx-frontend/lx-complexity');

lxComplexity() // 返回下面格式的JSON数组 ⬇️

/*
interface Message {
  ruleId: string;
  method: string;
  complexity: number;
  line: number;
  column: number;
  message: string;
  nodeType: string;
}
// 复杂度信息对象 具体含义可以看下方说明

interface Complexity {
  file: string; // 文件所在目录
  message: Message; // 复杂度分析信息
}

type ComplexityData = Complexity[];
*/

Return

字段 说明 类型
ruleId Eslint检查对应的ruleId(这里值为complexity) String
method 函数名 String
complexity 圈复杂度 Number
line 对应的行数 Number
column 对应的列数 Number
message Eslint检查返回的信息 String
nodeType Eslint解析函数对应的节点类型 String

Readme

Keywords

none

Package Sidebar

Install

npm i @lx-frontend/node-complexity

Weekly Downloads

0

Version

1.1.1

License

ISC

Unpacked Size

4.41 kB

Total Files

3

Last publish

Collaborators

  • ruqimobile
  • haiyulu
  • erica.liuyj
  • pok.h
  • chenzian
  • azumia
  • jeely
  • lichao.franklee
  • mind29
  • yuki.liu
  • lixinleon
  • frontbot
  • owen.huang
  • tiny.tu
  • simba.wang