A report card for your Go application

Go Report Card Build Status License

Go Report Card

A web application that generates a report on the quality of an open source go project. It uses several measures, including gofmt, go vet, go lint and gocyclo. To get a report on your own project, try using the hosted version of this code running at goreportcard.com.

Sponsors

Support us over on Patreon!

Installation

Assuming you already have a recent version of Go installed, pull down the code with go get:

go get github.com/gojp/goreportcard

Go into the source directory and pull down the project dependencies:

cd $GOPATH/src/github.com/gojp/goreportcard
make install

Now run

make start

and you should see

Running on 127.0.0.1:8000...

Navigate to that URL in your browser and check that you can see the front page.

Command Line Interface

There is also a CLI available for grading applications on your local machine.

Example usage:

go get github.com/gojp/goreportcard/cmd/goreportcard-cli
cd $GOPATH/src/github.com/gojp/goreportcard
goreportcard-cli
Grade: A+ (99.9%)
Files: 362
Issues: 2
gofmt: 100%
go_vet: 99%
gocyclo: 99%
golint: 100%
ineffassign: 100%
license: 100%
misspell: 100%

Verbose output is also available:

goreportcard-cli -v
Grade: A+ (99.9%)
Files: 332
Issues: 2
gofmt: 100%
go_vet: 99%
go_vet  vendor/github.com/prometheus/client_golang/prometheus/desc.go:25
        error: cannot find package "github.com/prometheus/client_model/go" in any of: (vet)

gocyclo: 99%
gocyclo download/download.go:22
        warning: cyclomatic complexity 17 of function download() is high (> 15) (gocyclo)

golint: 100%
ineffassign: 100%
license: 100%
misspell: 100%

Contributing

Go Report Card is an open source project run by volunteers, and contributions are welcome! Check out the Issues page to see if your idea for a contribution has already been mentioned, and feel free to raise an issue or submit a pull request.

Academic Citation

If you use Go Report Card for academic purposes, please use the following citation:

@Misc{schaaf-smith-goreportcard,
    author = {Schaaf, Herman and Smith, Shawn},
    title  = {Go Report Card: A report card for your Go application},
    year   = {2015--},
    url    = {https://www.goreportcard.com/},
    note   = {[Online; accessed <today>]}
}

License

The code is licensed under the permissive Apache v2.0 licence. This means you can do what you like with the software, as long as you include the required notices. Read this for a summary.

Notes

We don't support Go Report Card on Windows.

Comments
  • go_vet reports unknown identifier in example code

    go_vet reports unknown identifier in example code

    For example, the github.com/gowww/compress package.

    The package name compress is suffixed with _test inside the example_test.go file. That's maybe why this go vet doesn't recognize the identifier reference.

    But it should. And locally, my go vet github.com/gowww/compress returns no error.

  • Line 1: warning: file is not gofmted with -s (gofmt)

    Line 1: warning: file is not gofmted with -s (gofmt)

    Line one is often a comment (i.e):

    // Welcome to MyGoApp this file is blah, blah, blah.

    Q: Why is a comment line on line one (1) captured for warning on 'gofmted' basis? Q: Is the suggestion that comments are to be avoided or wrapped in 'gofmt' ?? Q: by design or false positive?

  • error:

    error: "Could not go get the repository"

    Hello!

    I've tried a few times to set up Go Report Card for my repo here: https://goreportcard.com/report/github.com/mdlayher/unifi_exporter.

    However, every time I try, I receive the error listed in the title. I suspect this may be because of a mismatch between the package name unifiexporter and the repository unifi_exporter, but would be curious if you all had any thoughts on the matter.

    Thanks for this great service!

  • go report error on github

    go report error on github

    hello, as title said

    The badge shows error.

    The badge could be accessed: https://goreportcard.com/badge/github.com/xujiajun/nutsdb

    The README.md of https://github.com/xujiajun/nutsdb

    can someone give me some advise?

  • We need to support git repositories outside of github.com

    We need to support git repositories outside of github.com

    Thank you for this great tool! We have been using this in our Github Enterprise repositories and integrated with our CI systems.

    I have noticed that the repository filename links aren't generated for non-github (like gitlab) and github enterprise repos. I have however managed to get it working by adding extra conditional statements to account for our enterprise repositoriy prefixes.

    I feel it would be good provide known repository prefixes in a config file and have goreportcard read that. This way we can ensure support for multiple git online repos like gitlab, github enterprise etc (and not just github.com)

    If you guys are okay with the direction of a config file, I am happy to submit a PR.

  • "Could not go get the repository."

    I'm unable to use this with https://github.com/purpleidea/mgmt/

    I get the following error message:

    There was an error processing your request: Could not go get the repository.

    Any help understanding why I get the error would be appreciated. Thanks!

  • New repo: github.com/mdlayher/vsock: could not download the repository

    New repo: github.com/mdlayher/vsock: could not download the repository

    Hi all, I love Go report card and use it with all my projects.

    Just created a new repository and any attempt to retrieve the report card results in an error.

    https://goreportcard.com/report/github.com/mdlayher/vsock

    There was an error processing your request: Could not download the repository.

    Any thoughts? Thanks again!

  • Please bump ineffassign to not report false positives

    Please bump ineffassign to not report false positives

    The ineffassign check seems to be pretty old and contain a bug. We see on https://goreportcard.com/report/github.com/kubevirt/kubevirt#ineffassign false positives, which don't happen with latest code from the ineffassign repo.

  • add badges assets for for-the-badge style

    add badges assets for for-the-badge style

    In the https://github.com/gojp/goreportcard/commit/8940f71383bfc212e7173e80f66ca55a3c0f1090, badges assets with some styles have been added. However, the style for-the-badge has not been added yet. Looks all the styles supported in Shield.io are supported, but actually ?style=for-the-badge is unavailable (404 Not Found appears if it's specified). Some people and I surely want the style badges (See: https://github.com/gojp/goreportcard/issues/7#issuecomment-367659982 and https://github.com/gojp/goreportcard/pull/262#issuecomment-492376744).

    I generated the for-the-badge styled badges with gh-badges by Shields.io. The colors are picked from the existing assets.

    Screenshot 2020-02-10 13 30 37
  • Check your Golint version

    Check your Golint version

    See

    https://goreportcard.com/report/github.com/bep/gr

    And

    https://play.golang.org/p/D-vWPKGnV2

    Your GoLint complains about:

    Line 42: warning: should omit type gr.Modifier from declaration of var itemStatus; it will be inferred from the right-hand side (golint)
    

    But, as in the example, the code won't compile without the type in the declaration, and my current GoLint setup does not complain about this.

  • Include minimum score of dependencies.

    Include minimum score of dependencies.

    The quality of dependencies an important point about the quality of the project.

    By including the scores of dependencies it makes it visible. It would also encourage collaboration, e.g. i write a package and get a score C because of a dependencies then I'm more motivated to improve that dependency.

    There's the question how to aggregate those dependencies. Minimum seems the most appropriate, chain is as weak as its weakest link.

  • Test files should not be analyzed

    Test files should not be analyzed

    Tests are not actively part of the codebase unless tests or benchmarks are being run. Also, not infrequently, to check edge cases or boundary conditions, one must do weird things in tests.

    It seems unfair to ding quality scores because unusual patterns show up in tests.

  • reportcard can't parse my code

    reportcard can't parse my code

    I can't figure out why the report card doesn't like my go module. I'm quite new to Go. Can someone help?

    Here's my code: https://gitlab.com/XenGi/dotfiles

    I'm getting this error:

    There was an error processing your request: Could not analyze the repository: could not download repo: could not get latest module version from https://proxy.golang.org/gitlab.com/xengi/dotfiles/@latest: not found: gitlab.com/xengi/dotfiles@latest: unrecognized import path "gitlab.com/xengi/dotfiles": parse https://gitlab.com/xengi/dotfiles?go-get=1: no go-import meta tags (meta tag gitlab.com/XenGi/dotfiles did not match import path gitlab.com/xengi/dotfiles)
    
  • cli alters generated files

    cli alters generated files

    Repo contains generated code that helpfully starts with

    // Code generated - DO NOT EDIT.
    

    Running the cli renames these files to foo.go.grc.bk and then leaves them like this.

    I would expect that the report card should not actually alter any files in anyway.

  • Forward query parameters to shields.io

    Forward query parameters to shields.io

    Related issues:

    • https://github.com/gojp/goreportcard/issues/304
    • https://github.com/gojp/goreportcard/issues/395

    Makes the go report badge customizable by forwarding some query string params and keeping the essential ones (like the message representing the grade

    cc: @shawnps @hermanschaaf

  • More customization for shields.io

    More customization for shields.io

    Decided to open a new issue as a continuation of https://github.com/gojp/goreportcard/issues/304, since it was closed and marked as stale.

    It would be nice to have the query parameters available by default on shields.io badges on this badge as well. Specifically these parameters:

    • color
    • labelColor
    • logo
    • logoColor
    • label
    • message (probably not this one since it's gonna override the report result)
    • logoWidth
    • style (this one seems to be available already)

    Currently the badge is redirected to the URL:

    https://img.shields.io/badge/<LABEL>-<MESSAGE>-<COLOR>
    

    Instead, it could be redirected to:

    https://img.shields.io/static/v1?label=<LABEL>&message=<MESSAGE>&color=<COLOR>
    

    By appending the other parameters to the query string:

    https://img.shields.io/static/v1?label=go%20report&message=A+&color=ff69b4&logo=go
    

    example

  • Report is generated for different tag and unable to change default branch

    Report is generated for different tag and unable to change default branch

    Hey all,

    I don't see an option to change the default branch for my project and also it seems report is generated for a really old tag instead.

    https://goreportcard.com/report/github.com/dnaeon/go-vcr

    How do I change the default branch?

    Thanks!

A Golang tool that does static analysis, unit testing, code review and generate code quality report.
A Golang tool that does static analysis, unit testing, code review and generate code quality report.

goreporter A Golang tool that does static analysis, unit testing, code review and generate code quality report. This is a tool that concurrently runs

Jan 8, 2023
Manage your repository's TODOs, tickets and checklists as config in your codebase.

tickgit ??️ tickgit is a tool to help you manage latent work in a codebase. Use the tickgit command to view pending tasks, progress reports, completio

Dec 30, 2022
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.

Clean Architecture checker for Golang go-cleanarch was created to keep Clean Architecture rules, like a The Dependency Rule and interaction between mo

Dec 31, 2022
Tool to populate your code with traceable and secure error codes

Essential part of any project, especially customer facing is proper and secure error handling. When error happens and customer reports it, it would be nice to know the context of the error and where it exactly occured.

Sep 28, 2022
This static analysis tool works to ensure your program's data flow does not spill beyond its banks.

Go Flow Levee This static analysis tool works to ensure your program's data flow does not spill beyond its banks. An input program's data flow is expl

Dec 1, 2022
🔒🌍 Security scanner for your Terraform code
🔒🌍 Security scanner for your Terraform code

????tfsec uses static analysis of your terraform templates to spot potential security issues.

Dec 30, 2022
Know when GC runs from inside your golang code

gcnotifier gcnotifier provides a way to receive notifications after every run of the garbage collector (GC). Knowing when GC runs is useful to instruc

Dec 26, 2022
dont-interface calculates how many interface{} are declared or used in your project?

dont-interface calculates how many interface{} are declared or used in your project?

Jun 9, 2022
Drone Plugin for detecting credentials or other sensitive data in your repository

A plugin to detect hard-coded secrets and sensitive data in your source code files. Building Build the plugin binary: scripts/build.sh Build the plug

Apr 21, 2022
Detect non-inclusive language in your source code.
Detect non-inclusive language in your source code.

Detect non-inclusive language in your source code. I stay woke - Erykah Badu Creating an inclusive work environment is imperative to a healthy, suppor

Dec 25, 2022
Act as part of the business code and will report aqua scan report after application installed
Act as part of the business code and will report aqua scan report after application installed

starboard-report This repo aim to enrich the functionality of starboard. Starboard integrates security tools into the Kubernetes environment, so that

Nov 25, 2021
kyoto uikit - UIKit for rapid development License Go Reference Go Report Card
kyoto uikit - UIKit for rapid development  License Go Reference Go Report Card

kyoto uikit UIKit for rapid development Requirements kyoto page configured SSA basic knowledge of kyoto (twui) configured tailwindcss Installation <ki

Jun 27, 2022
Command line tool to copy images from a camera SD card to your hard drive

Command line tool to copy images from a camera SD card to your hard drive

Nov 26, 2021
Sapfun - Utility that takes control over your video card coolers to keep it cool and steady

What? sapfun - Utility that takes control over your video card coolers to keep i

Feb 18, 2022
`age-plugin-yubikey` implementation, encrypt things with a Yubikey/any PIV card

This is an age plugin for PIV cards/Yubikey. Your secret is kept safe on the tamperproof hardware, while letting you use the age command-line.

Aug 10, 2022
The bare metal Go smart card
The bare metal Go smart card

Authors Andrea Barisani [email protected] | [email protected] Introduction The GoKey application implements a USB smartcard in pure Go

Dec 8, 2022
Uno card game implemented in Go with gRPC

Uno card game implemented in Go with gRPC

Mar 11, 2022
Discord webhooks dispatcher for the ZUnivers card game (not affiliated)
Discord webhooks dispatcher for the ZUnivers card game (not affiliated)

ZUnivers-Webhooks Discord webhooks dispatcher for the ZUnivers card game. Disclaimer This is project is not affiliated with the ZUnivers's project. It

Sep 28, 2022
Read RFID card data so Protospace directors can assign them to users!

RFID Reader Dependencies This application was developed with: go1.17.5 linux/amd64 xclip version 0.13 (if you're on Linux) Find go for your OS and arc

Dec 15, 2021