loc

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package loc provides functions to calculate lines of code for a Golang project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLOC

type FileLOC struct {
	Package string `json:"package"` // package name
	File    string `json:"file"`    // file name
	LOC     int    `json:"loc"`     // number of lines of code for this file
}

FileLOC represents the total lines of code for a specific code file

type PackageLOC

type PackageLOC struct {
	Package string `json:"package"` // package name
	LOC     int    `json:"loc"`     // number of lines of code for this package
}

PackageLOC represents the total lines of code for a specific package

type ProjectLOC

type ProjectLOC struct {
	Total    int          `json:"total"`    // number of lines of code for the whole project
	Packages []PackageLOC `json:"packages"` // detailed information by package
	Files    []FileLOC    `json:"files"`    // detailed information by file
}

ProjectLOC represents the total lines of code for a project

func CountLoc

func CountLoc(prj *project.ProjectInfo) (*ProjectLOC, error)

CountLoc retrieves the Lines of Code metrics for a Golang project. LocMetric contains lines of code aggregated by: file, package and project.

An error is returned when it's not possible to get the packages information

Jump to

Keyboard shortcuts

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