goreporter 代码扫描

goreporter 代码扫描

  1. 支持的特性

gofmt - Checks if the code is properly formatted and could not be further simplified.
govet - Reports variables that may have been unintentionally shadowed.
golint - Golint is a linter for Go source code.
unittest - Golang unit test status.
deadcode - Finds unused code.
gocyclo - Computes the cyclomatic complexity of functions.
varcheck - Find unused global variables and constants.
structcheck - Find unused struct fields.
aligncheck - Warn about un-optimally aligned structures.
errcheck - Check that error return values are used.
copycode(dupl) - Reports potentially duplicated code.
gosimple - Report simplifications in code.
staticcheck - Statically detect bugs, both obvious and subtle ones.
godepgraph - Godepgraph is a program for generating a dependency graph of Go packages.
misspell - Correct commonly misspelled English words... quickly.
countcode - Count lines and files of project.
interfacer - Suggest narrower interfaces that can be used.
depth - Count the maxdepth of go functions.
flen - Flen provides stats on functions/methods lengths in a Golang package.

2.用法

goreporter -p [projectRelativePath] -r [reportPath] -e [exceptPackagesName] -f [json/html/text]  {-t templatePathIfHtml}

3.使用示例

goreporter -p ./xxx -r ../

4.结果输入

http://wgliang.github.io/pages/goreporter-report.html

5.相关链接

https://github.com/360EntSecGroup-Skylar/goreporter

原文地址:https://www.cnblogs.com/tomtellyou/p/13162210.html