@lx-frontend/lx-complexity

1.0.0-beta.3 • 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

/@lx-frontend/lx-complexity/

    Package Sidebar

    Install

    npm i @lx-frontend/lx-complexity

    Weekly Downloads

    4

    Version

    1.0.0-beta.3

    License

    ISC

    Unpacked Size

    13.9 kB

    Total Files

    7

    Last publish

    Collaborators

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