scanner

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseProjectLangStat

func ParseProjectLangStat(jsonBytes []byte, projectLangStat *ProjectLangStat) error

ParseProjectLangStat 反序列化json到ProjectLangStat

Types

type LangStatHeader

type LangStatHeader struct {
	ClocUrl        string  `json:"cloc_url"`         // cloc的GitHub地址
	ClocVersion    string  `json:"cloc_version"`     //版本
	ElapsedSeconds float64 `json:"elapsed_seconds"`  //扫描所用的时间(秒)
	NFiles         uint32  `json:"n_files"`          //扫描的文件总数
	NLines         uint32  `json:"n_lines"`          //扫描的行数总数
	FilesPerSecond float64 `json:"files_per_second"` //每秒扫描文件的数目
	LinesPerSecond float64 `json:"lines_per_second"` //每秒扫描行的数目
}

type LanguageStat

type LanguageStat struct {
	NFiles  uint32 `json:"nFiles"`  // 使用该编程语言编写的文件数
	Blank   uint32 `json:"blank"`   // 该编程语言的空行数
	Comment uint32 `json:"comment"` // 该编程语言的注释行数
	Code    uint32 `json:"code"`    // 该编程语言的代码行数
}

type ProjectLangStat

type ProjectLangStat struct {
	Header LangStatHeader          `json:"header"`
	Langs  map[string]LanguageStat `json:"langs"`
}

func ScanLanguage

func ScanLanguage(filePath string) (*ProjectLangStat, error)

Jump to

Keyboard shortcuts

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