splint

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2019 License: MIT Imports: 8 Imported by: 0

README

splint

Build Status GoDoc Go Report Coverage

splint is a little Go application to analyze Go source files. It finds any functions that are too long or have too many parameters or results.

These are typical signs that a function is doing too much. We find splint to be a helpful tool for detecting potential problem areas in our code, areas that should be refactored. We tolerate long functions and functions with long parameter/result lists when they are needed, but generally try to keep them short.

Installation

Use go install:

go install github.com/agflow/splint

About

This is a fork of splint.

Documentation

Overview

splint is a little Go application to analyze Go source files. It finds any functions that are too long or have too many parameters or results.

find . -name "*.go" -exec splint {} \; By default, splint will inform you of any functions that are more than 30 statements long, have more than five parameters, or have more than five results.

You can change these values with command line flags. -s sets the statement count threshold, -p sets the parameter count threshold, and -r sets the result count threshold. Check for all functions with more than 50 statements, 10 parameters, 7 results: splint -s=50 -p=10 -r=7 **/*.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL