{"_id":"@afuteam-nx/plugin-code-complexity","_rev":"1-756d9c2fd93db978385f2b13bf996189","name":"@afuteam-nx/plugin-code-complexity","dist-tags":{"next":"0.0.1","latest":"0.0.2"},"versions":{"0.0.1":{"name":"@afuteam-nx/plugin-code-complexity","version":"0.0.1","dependencies":{"@nx/devkit":"18.0.5","tslib":"^2.3.0"},"keywords":["@afuteam-nx","nx","plugins","complexity","switchcase"],"type":"commonjs","main":"./src/index.js","typings":"./src/index.d.ts","executors":"./executors.json","_id":"@afuteam-nx/plugin-code-complexity@0.0.1","gitHead":"0d5d8b1eab969f0522412ec3173e5da4df98af61","description":"对代码仓库执行代码质量的复杂度检查，支持批量项目。","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-DSKuHAkSDWUhoWsr83Klgsl6ZHVxuVusTEsxKYeJsmmf4OJ1StpLV+qHcSJFHMuvkDygypIbj6nhEpjdUxPmGQ==","shasum":"a5ff69377f087a56296f20abb457f84dd78c85c0","tarball":"https://registry.npmjs.org/@afuteam-nx/plugin-code-complexity/-/plugin-code-complexity-0.0.1.tgz","fileCount":12,"unpackedSize":16129,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYyprCeZEuI27k1S8hmoEJ06vQN0HlumGNCu5+LbyGaAiEAsR5N9auG/vJa1l+ymX/5GxC0bIB920wKms1KWSmozsE="}]},"_npmUser":{"name":"eyea","email":"deyesea@gmail.com"},"directories":{},"maintainers":[{"name":"eyea","email":"deyesea@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-code-complexity_0.0.1_1710247070478_0.8879193881380343"},"_hasShrinkwrap":false},"0.0.2":{"name":"@afuteam-nx/plugin-code-complexity","version":"0.0.2","dependencies":{"@nx/devkit":"18.2.3","tslib":"^2.3.0"},"keywords":["@afuteam-nx","nx","plugins","complexity","switchcase"],"type":"commonjs","main":"./src/index.js","typings":"./src/index.d.ts","executors":"./executors.json","_id":"@afuteam-nx/plugin-code-complexity@0.0.2","gitHead":"c09bd6fefc7eaba2cbaea776898eee707928af76","description":"对代码仓库执行代码质量的复杂度检查，支持批量项目。","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-d8PFJfeKtBOQGq6tuMxVPEC/TQqEmGNEEFPhJoLuO40SGr3wDqN9yU/1E2RddqGsqQcIIKyWC+QVebK6ymrKcA==","shasum":"b5b1991a1efdc6fae72eecd59b25477f60c6e6c8","tarball":"https://registry.npmjs.org/@afuteam-nx/plugin-code-complexity/-/plugin-code-complexity-0.0.2.tgz","fileCount":14,"unpackedSize":17249,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbWnCwck+SANfjc6eIDkuvpFGbBfYUC8gZlTP+azO35AIgBCdUAPWfHHAMcTZJ4BeNMnlo/JPlSYGggAqVE+QIYdw="}]},"_npmUser":{"name":"eyea","email":"deyesea@gmail.com"},"directories":{},"maintainers":[{"name":"eyea","email":"deyesea@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-code-complexity_0.0.2_1712578955753_0.4112122059969252"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-12T12:37:50.325Z","0.0.1":"2024-03-12T12:37:50.636Z","modified":"2024-04-08T12:22:36.104Z","0.0.2":"2024-04-08T12:22:35.895Z"},"maintainers":[{"name":"eyea","email":"deyesea@gmail.com"}],"description":"对代码仓库执行代码质量的复杂度检查，支持批量项目。","keywords":["@afuteam-nx","nx","plugins","complexity","switchcase"],"readme":"# plugin-code-complexity\n\n对代码仓库执行代码质量的复杂度检查，支持批量项目。\n\n\n## 环境\n本插件基于 `nx` 开发，请在对应初始化好的 `your-app` 中使用\n\n本插件的输入文件建议使用 [@afuteam-nx/plugin-add-eslint-type](https://www.npmjs.com/package/@afuteam-nx/plugin-add-eslint-type) 生成的文件\n\n本插件受益于 [@afuteam/eslint-plugin-fe](https://www.npmjs.com/package/@afuteam/eslint-plugin-fe) 提供代码 `complexity-without-switchcase` 规则，改规则基于 `complexity`，但忽略 `switch` 语句\n\n## 安装\n\n```bash\npnpm i @afuteam-nx/plugin-code-complexity -D\n```\n\n## 配置\n```bash\n# 在 apps/your-app/project.json 中配置\n\"targets\": {\n  \"fetch-repos\": {\n    \"executor\": \"@afuteam-nx/plugin-code-complexity:run\",\n    \"options\": {\n      \"localFileReposWithAFULintTypePath\": \"项目清单需要有 AFULintType 字段, allProjectsWithLinType.json\",\n      \"localFilesAllReposCodePath\": \"本地的要执行 eslint 源代码路径\",\n      \"resultPath\": \"结果输出路径 文件名 allProjectsWithCodeComplexity.json\"\n    }\n  }\n}\n\n```\n\n## 使用\n```bash\nnx run your-app:code-complexity\n```\n\n## 文件数据结构\n`allProjectsWithLinType.json`\n```json\n[\n  {\n    \"id\": 28612,\n    \"created_at\": \"2023-11-21T15:23:21.637+08:00\",\n    \"last_activity_at\": \"2024-03-04T20:41:10.727+08:00\",\n    \"name\": \"sky\",\n    \"AFULintType\": {\n      \"root\": \"react-ts\"\n    },\n    \"web_url\": \"https://gitlab.com/afuteam/sky\"\n  }\n]\n```\n\n`allProjectsWithCodeComplexity.json`\n```json\n[\n  {\n    \"id\": 28005,\n    \"created_at\": \"2023-08-22T14:02:51.065+08:00\",\n    \"last_activity_at\": \"2024-01-04T19:56:40.565+08:00\",\n    \"name\": \"sky\",\n    \"web_url\": \"https://gitlab.com/afuteam/sky\",\n    \"complexityDataLength\": 3,\n    \"complexityData\": [\n      {\n        \"ruleId\": \"@afuteam/fe/complexity-without-switchcase\",\n        \"severity\": 2,\n        \"message\": \"Generator method 'getCurrentAccount' has a complexity of 27. Maximum allowed is 20.\",\n        \"line\": 43,\n        \"column\": 23,\n        \"nodeType\": \"FunctionExpression\",\n        \"messageId\": \"@afuteam/fe/complexity-without-switchcase\",\n        \"endLine\": 77,\n        \"endColumn\": 6\n      },\n      {\n        \"ruleId\": \"@afuteam/fe/complexity-without-switchcase\",\n        \"severity\": 2,\n        \"message\": \"Arrow function has a complexity of 22. Maximum allowed is 20.\",\n        \"line\": 22,\n        \"column\": 49,\n        \"nodeType\": \"ArrowFunctionExpression\",\n        \"messageId\": \"@afuteam/fe/complexity-without-switchcase\",\n        \"endLine\": 338,\n        \"endColumn\": 2\n      },\n      {\n        \"ruleId\": \"@afuteam/fe/complexity-without-switchcase\",\n        \"severity\": 2,\n        \"message\": \"Arrow function has a complexity of 32. Maximum allowed is 20.\",\n        \"line\": 26,\n        \"column\": 59,\n        \"nodeType\": \"ArrowFunctionExpression\",\n        \"messageId\": \"@afuteam/fe/complexity-without-switchcase\",\n        \"endLine\": 450,\n        \"endColumn\": 2\n      }\n    ]\n  },\n]\n```\n\n\n\n","readmeFilename":"README.md"}