Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureGc()
- func CountStats(fileJob *FileJob)
- func EstimateCost(effortApplied float64, averageWage int64) float64
- func EstimateEffort(sloc int64) float64
- func EstimateScheduleMonths(effortApplied float64) float64
- func Process()
- func ProcessConstants()
- type CheckDuplicates
- type FileJob
- type FileJobCallback
- type Language
- type LanguageFeature
- type LanguageSummary
- type LineType
- type OpenClose
- type Trie
Constants ¶
const ( T_STRING int = iota + 1 T_SLCOMMENT T_MLCOMMENT T_COMPLEXITY )
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 ¶
var AverageWage int64 = 56286
var Cocomo = false
var Complexity = false
var Debug = false
var DirFilePaths = []string{}
Not set via flags but by arguments following the the flags
var DisableCheckBinary = false
var Duplicates = false
var Exclude = ""
var ExtensionToLanguage = map[string]string{}
Loaded from the JSON that is in constants.go
var FileListQueueSize = runtime.NumCPU()
var FileOutput = ""
var FileProcessJobQueueSize = runtime.NumCPU()
var FileProcessJobWorkers = runtime.NumCPU() * 4
var FileReadContentJobQueueSize = runtime.NumCPU()
var FileReadJobQueueSize = runtime.NumCPU()
var FileReadJobWorkers = runtime.NumCPU() * 4
var FileSummaryJobQueueSize = runtime.NumCPU()
var Files = false
Flags set via the CLI which control how the output is displayed
var Format = ""
var GcFileCount = 10000
var LanguageFeatures = map[string]LanguageFeature{}
var Languages = false
var More = false
var PathBlacklist = ""
var SortBy = ""
var Trace = false
var Verbose = false
var WhiteListExtensions = ""
Functions ¶
func ConfigureGc ¶ added in v1.10.0
func ConfigureGc()
This needs to be set outside of ProcessConstants because it should only be enabled in command line mode https://github.com/boyter/scc/issues/32
func CountStats ¶ added in v1.4.0
func CountStats(fileJob *FileJob)
CountStats will process the fileJob If the file contains anything even just a newline its line count should be >= 1. If the file has a size of 0 its line count should be 0. Newlines belong to the line they started on so a file of \n means only 1 line This is the 'hot' path for the application and needs to be as fast as possible
func EstimateCost ¶
Calculate the cost in dollars applied using generic COCOMO2 weighted values based on the average yearly wage
func EstimateEffort ¶
Calculate the effort applied using generic COCOMO2 weighted values
func EstimateScheduleMonths ¶
func ProcessConstants ¶ added in v1.4.0
func ProcessConstants()
ProcessConstants is responsible for setting up the language features based on the JSON file that is stored in constants Needs to be called at least once in order for anything to actually happen
Types ¶
type CheckDuplicates ¶
type CheckDuplicates struct {
// contains filtered or unexported fields
}
func (*CheckDuplicates) Add ¶
func (c *CheckDuplicates) Add(key int64, hash []byte)
type FileJobCallback ¶ added in v1.4.0
type FileJobCallback interface { // ProcessLine should return true to continue processing or false to stop further processing and return ProcessLine(job *FileJob, currentLine int64, lineType LineType) bool }
FileJobCallback is an interface that FileJobs can implement to get a per line callback with the line type
type Language ¶
type Language struct { LineComment []string `json:"line_comment"` ComplexityChecks []string `json:"complexitychecks"` Extensions []string `json:"extensions"` ExtensionFile bool `json:"extensionFile"` MultiLine [][]string `json:"multi_line"` Quotes [][]string `json:"quotes"` NestedMultiLine bool `json:"nestedmultiline"` }