DeepCodeAPI客户端(人工智能代码分析)

deepcode的Python项目详细描述


DeepCode的命令行界面

deepcode

安装

最低支持的python版本是:3.6.5

安装PyPI

皮普:

pip install deepcode

诗歌:

^{pr2}$

有关详细信息,请参见deepcode project on PYPI

本地安装包和开发模式

有关详细信息,请参阅development docs

命令行接口

deepcode --help

Usage: deepcode [OPTIONS] COMMAND [ARGS]...

  A tool, that detects bugs and quality issues in JavaScript, TypeScript,
  Python, Java and C/C++. It uses a mighty engine based on AI from Deepcode.

Options:
  -s, --service-url TEXT  Custom DeepCode service URL (default:
                          https://www.deepcode.ai)
  -a, --api-key TEXT      Deepcode API key
  -c, --config-file FILE  Config file (default: ~/.deepcode.json)
  --help                  Show this message and exit.

Commands:
  analyze  Analyzes your code using Deepcode AI engine.
  config   Store configuration values in a file.
  login    Initiate a new login protocol.
  • 登录:这将打开一个浏览器窗口来登录DeepCode。
    deepcode login
    
  • 创建/更新配置:这将引导您完成一些配置步骤,以防您不想连接到 https://www.deepcode.ai但对于运行DeepCode实例的其他主机。
    deepcode config
    
  • 分析:对特定版本的代码进行分析。这将显示代码中存在的所有建议。在
Usage: deepcode analyze [OPTIONS]

  Analyzes your code using Deepcode AI engine.

  Exit codes:
  0 - not issues found
  1 - some issues found
  2 - Execution was interrupted by the user
  3 - Some error happened while executing

Options:
  Source location: [mutually_exclusive, required]
                                  The configuration of repository location
    -p, --path DIRECTORY          Path to folder to be processed. Multiple
                                  paths are allowed
    -r, --git-uri REMOTE          Git URI (e.g.
                                  git@<platform>:<owner>/<repo>.git@<oid> or
                                  https://<platform>/<owner>/<repo>.git@<oid>)
  -l, --with-linters              Enable linters
  -log, --log-file FILE           Forward all debugging messages to a file
  -txt, --result-text             Present results in txt format
  -sev, --severity [info|warning|critical]
                                  Minimum severity level (default: info)
  --help                          Show this message and exit.

示例:

deepcode analyze --path (<folder path one>) --path (<folder path two>) --with-linters --log-file=~/.deepcode.log -txt --severity warning

deepcode analyze --path (<folder path one>)
deepcode analyze --git-uri git@github.com:DefinitelyTyped/DefinitelyTyped.git --with-linters

json格式的分析结果,如here

Python本机用法

DeepCode CLI也可以作为一个模块使用,可以通过python导入系统导入到另一个python代码中。在

要使用这两个函数,请确保使用API键设置环境变量“DEEPCODE_API_KEY”,即can be obtained here

要使用Deepcode的自管理实例,请为其用户设置环境变量“Deepcode_SERVICE_URL”(例如https://example.org

可用方法:

  • 分析_文件夹(路径,linters_enabled=False):

    :param [paths] - Paths should be a list of absolute paths to bundle dir
    :param [linters_enabled] - optional. requests also linter analysis
    :return - dictionary with results e.g. as described [here](https://www.deepcode.ai/docs/REST%20APIs%2FBundles) plus: 'id' for bundle id and 'url' for online view of analysis results
    
    example:
    import deepcode
    deepcode.analyze_folders('<path to files dir>')
    
  • 分析\u git(平台,所有者,repo,oid=None,linters_enabled=False):

    :param [platform] - github.com, bitbucket.org, gitlab.com.
    :param [owner] - repository account. (e.g. facebook)
    :param [repo] - repository. (e.g. react)
    :param [linters_enabled] - optional. requests also linter analysis
    :return - dictionary with results e.g. as described [here](https://www.deepcode.ai/docs/REST%20APIs%2FBundles) plus: 'id' for bundle id and 'url' for online view of analysis results
    
    example:
    import deepcode
    deepcode.analyze_git('github.com', 'facebook', 'react')
    

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
相对于框架java窗口的鼠标位置错误   Java 8流peek api   java将数据附加到文件中   java使用ExoPlayer 2.8播放播放列表中的特定文件   JavaSpring国际化:如何动态设置语言环境值   java如何在mysql中实现两个表之间的两个关联   java在gradle可执行jar文件中包含运行时参数   surefire插件中的java maven多套测试套件   java试图理解堆分析以确定内存泄漏或所需的大量内存   java识别字符串有数字   数组如何解决错误“java.lang.ArrayIndexOutOfBoundsException:5”   java Swt文件对话框选择的文件太多?   java此登录代码易受SQL注入攻击吗?   Java[3]中的文件<identifier>预期编译错误   java如何在spring webflux中发送列表   jar中未找到java文件异常   如何在java中合并2D数组?   java如何评测本机JNI库