You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
张洋 8422330cbf
第一次提交
3 months ago
..
API.md 第一次提交 3 months ago
README.md 第一次提交 3 months ago
backend.js 第一次提交 3 months ago
frontend.html 第一次提交 3 months ago
simple_test.html 第一次提交 3 months ago
test_refresh.html 第一次提交 3 months ago

README.md

代码质量检查后端启动手册

前提条件

  • Node.js 已安装(版本 >= 14
  • Python 3.9 已安装且bandit、flake8、pylint 通过pip安装。
  • 依赖express、multer、cors运行npm install express multer cors安装)。

启动步骤

  1. 导航到项目目录:

    cd D:\软件工程\代码质量检查\src
    
  2. 安装Node.js依赖如果尚未

    npm install express multer cors
    
  3. 启动后端服务器:

    node view/backend.js
    
  4. 测试API

    • 使用curl示例或前端页面如果有view/frontend.html,通过浏览器打开并提交)。
    • 示例:上传test_sample.py选择所有工具检查响应JSON。

停止服务器

按Ctrl+C在终端中停止。

常见问题

  • 如果端口3000被占用修改app.listen(3000)为其他端口如5000
  • CORS错误确保cors已启用如果从本地文件测试前端使用Live Server扩展避免origin null。
  • 工具失败检查Python PATH工具必须在系统PATH中可用