codescore

package module
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

README

OVERVIEW

Go Reference Go Report Card Go Build

paepcke.de/codescore

  • Calculate a code quality score
  • Based on number of golang (idomatic) code style violations per lines of code
  • 100 % golang, minimal (external) imports, use as app or api (see api.goo)

INSTALL

go install paepcke.de/codescore/cmd/codescore@latest
DOWNLOAD (prebuild)

github.com/paepckehh/codescore/releases

SHOWTIME

Summary one-liner!

codescore .
[score:100/100] [loc:669] [err:0] -> [/usr/store/dev/codescore]

Details why?

codescore  --verbose .
[score:099/100] [loc:1752] [err:40] -> [/usr/store/dev/asn2pf]
/usr/store/dev/asn2pf/asnfetch/api.go:48:4: if c { ... } else { ... continue } can be simplified to if !c { ... continue } ...
/usr/store/dev/asn2pf/asnfetch/api.go:71:6: explicit call to the garbage collector
[...]

More?

codescore  --help
syntax: codescore [options] <file|directory>

--file [-f]
		create .go.codescore info file

--file-full [-F]
		create .go.codescore info file and dump all details into the file

--score-only [-s]
		print only the score to stdout

--enable-hidden-files [-e]
		enable scanning hidden files and directories

--exclude [-e]
		exclude all directories matching any of the keywords
		this option can be specified several times

--verbose [-v]
--silent [-q]
--debug [-d]
--help [-h]

DOCS

pkg.go.dev/paepcke.de/codescore

CONTRIBUTION

Yes, Please! PRs Welcome!

Documentation

Overview

package codescore provides a code quality score

package codescore

package codescore

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path       string
	Exclude    []string
	File       bool
	FileFull   bool
	ScoreOnly  bool
	SkipHidden bool
	Verbose    bool
	Silent     bool
	Goo        bool
	Debug      bool
}

Config ...

func GetDefaultConfig

func GetDefaultConfig() *Config

GetDefaultConfig returns and Config object with sane defaults

func (*Config) Start

func (c *Config) Start() string

Start calculates the codescore for all go source files in c.Path

Directories

Path Synopsis
cmd
codescore
package main ...
package main ...

Jump to

Keyboard shortcuts

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