IDEA SonarLint安装及使用

SonarLint安装提示需要JDK8。JDK7未测试,不能确保成功。

SonarLint插件安装

  1. IDEA菜单栏选择File->Settings,左边栏选择Plugins
    IDEA Setting

  2. 在线安装选择Browse repositories,搜索Sonar,选择SonarLint进行安装,之后重启IDEA
    IDEA SonarLint

IDEA SonarLint使用

  1. 安装SonarLint插件重启后,IDEA Tool Windows部分会出现SonarLint View。如果没有出现,选择菜单View->Tool Windows->SonarLint会显示
    IDEA SonarLint使用

    SonarLint安装完后,默认情况下是自动检测项目代码的。若觉得影响效率,可通过菜单Settings->Other Settings->SonarLint General Settings进行设置
    IDEA SonarLint Automatic

  2. 手动检测代码时,在Tool Windows中选择Scope(可选择All project files或者VCS changed files),再点击左侧的Analyze按钮进行检测
    IDEA SonarLint Manual Anylyze

  3. 检测完毕后,会在SonarLint Tool View中显示出检测的问题,以类名称进行分类。各类的issue,分为阻断、严重、主要、提示和次要,问题严重性依次降低。点击issue,在右侧会出现对应的Rule,可参照进行修改
    IDEA SonarLint Issue

Eclipse SonarLint安装及使用

Eclipse SonarLint安装及使用请参阅SonarLint插件的安装与使用

更多资料

  1. SonarLint

猜你喜欢

转载自blog.csdn.net/xl890727/article/details/79400130
今日推荐