Skip to content
Go package for quality assessment at src level
Go Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
internal/find
vendor
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
go.mod
go.sum
onchange.sh
package.go
qual.go
qual_test.go
types.go
z_test.go

README.md

Build Status codecov Maintainability

qual - Go package for quality assessment at source code level

Quick start

go get github.com/gregoryv/qual

Add a unit test to your project

func Test_CodeQuality(t *testing.T) {
    qual.Standard(t)
}

or if you are really brave, do

func Test_CodeQuality(t *testing.T) {
    qual.High(t)
}

The predefined tests measure

  • code complexity
  • line width

where the qual.Standard test only checks your package and qual.High also includes vendored code.

Scope

This package helps to improve code readability. Note, it's not measuring the quality of features in your solution. Those are better measured with benchmarks and user experience. The quality of the source code helps developers pass on their intent of their solution to other developers. We do this in various ways

  • documenting
  • tests and examples and most importantly
  • writing readable code

If we can write readable code, documentation can be minimized and that is always good, since developers tend to prefer writing code over documentation.

Assert

For a period this package came with an Assert func that parsed code to create presentable error messages. This proved to be less readable than intended(available in 0.2.1). However minimizing complexity by removing one pathway is still provided in asserter package.

You can’t perform that action at this time.