processor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2018 License: MIT, Unlicense Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	S_BLANK              int64 = 1
	S_CODE               int64 = 2
	S_COMMENT            int64 = 3
	S_COMMENT_CODE       int64 = 4 // Indicates comment after code
	S_MULTICOMMENT       int64 = 5
	S_MULTICOMMENT_CODE  int64 = 6 // Indicates multi comment after code
	S_MULTICOMMENT_BLANK int64 = 7 // Indicates multi comment ended with blank afterwards
	S_STRING             int64 = 8
)

Variables

View Source
var AverageWage int64 = 56286
View Source
var Cocomo = false
View Source
var Complexity = false
View Source
var Debug = false
View Source
var DirFilePaths = []string{}

Not set via flags but by arguments following the the flags

View Source
var Duplicates = false
View Source
var ExtensionToLanguage = map[string]string{}

Loaded from the JSON that is in constants.go

View Source
var FileListQueueSize = runtime.NumCPU()
View Source
var FileProcessJobQueueSize = runtime.NumCPU()
View Source
var FileReadContentJobQueueSize = runtime.NumCPU()
View Source
var FileReadJobQueueSize = runtime.NumCPU()
View Source
var FileSummaryJobQueueSize = runtime.NumCPU()
View Source
var Files = false

Flags set via the CLI which control how the output is displayed

View Source
var LanguageFeatures = map[string]LanguageFeature{}
View Source
var More = false
View Source
var PathBlacklist = ""
View Source
var SortBy = ""
View Source
var Trace = false
View Source
var Verbose = false
View Source
var WhiteListExtensions = ""

Functions

func EstimateCost

func EstimateCost(effortApplied float64, averageWage int64) float64

Calculate the cost in dollars applied using generic COCOMO2 weighted values based on the average yearly wage

func EstimateEffort

func EstimateEffort(sloc int64) float64

Calculate the effort applied using generic COCOMO2 weighted values

func EstimateScheduleMonths

func EstimateScheduleMonths(effortApplied float64) float64

func Process

func Process()

Types

type CheckDuplicates

type CheckDuplicates struct {
	// contains filtered or unexported fields
}

func (*CheckDuplicates) Add

func (c *CheckDuplicates) Add(key int64, hash []byte)

func (*CheckDuplicates) Check

func (c *CheckDuplicates) Check(key int64, hash []byte) bool

type FileJob

type FileJob struct {
	Language           string
	Filename           string
	Extension          string
	Location           string
	Content            []byte
	Bytes              int64
	Lines              int64
	Code               int64
	Comment            int64
	Blank              int64
	Complexity         int64
	WeightedComplexity float64
	Hash               []byte
}

type Language

type Language struct {
	LineComment      []string   `json:"line_comment"`
	ComplexityChecks []string   `json:"complexitychecks"`
	Extensions       []string   `json:"extensions"`
	MultiLine        [][]string `json:"multi_line"`
	Quotes           [][]string `json:"quotes"`
}

type LanguageFeature

type LanguageFeature struct {
	ComplexityChecks  [][]byte
	ComplexityBytes   []byte
	SingleLineComment [][]byte
	MultiLineComment  []OpenClose
	StringChecks      []OpenClose
}

type LanguageSummary

type LanguageSummary struct {
	Name               string
	Bytes              int64
	Lines              int64
	Code               int64
	Comment            int64
	Blank              int64
	Complexity         int64
	Count              int64
	WeightedComplexity float64
	Files              []*FileJob
}

type OpenClose

type OpenClose struct {
	Open  []byte
	Close []byte
}

Jump to

Keyboard shortcuts

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