< Summary - Repometa Coverage

Information
Class: cDetector
Assembly: repometa
File(s): /home/runner/work/repometa/repometa/detect_c.go
Line coverage
100%
Covered lines: 15
Uncovered lines: 0
Coverable lines: 15
Total lines: 27
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
detect0%00100%

File(s)

/home/runner/work/repometa/repometa/detect_c.go

#LineLine coverage
 1package repometa
 2
 3import "fmt"
 4
 5type cDetector struct{}
 6
 7// C source directories are common inside larger projects, so this detector
 8// reports every directory that contains .c / .h files. The post-filter
 9// pass in Scan drops findings that live inside a component of a more
 10// structured kind (Make / CMake / etc), so what remains is only "loose"
 11// C source trees the caller may want to know about.
 8412func (cDetector) detect(dv dirVisit, cfg options) []finding {
 8413  _ = cfg // detector inspects only directory entries; cfg unused.
 8414  sources := countByExt(dv.files, ".c")
 8415  headers := countByExt(dv.files, ".h")
 8016  if sources == 0 && headers == 0 {
 8017    return nil
 8018  }
 419  return []finding{{
 420    Kind:       KindCSource,
 421    Confidence: 0.6,
 422    Evidence: []Evidence{{
 423      Path:   dv.rel,
 424      Reason: fmt.Sprintf("directory contains %d .c and %d .h file(s)", sources, headers),
 425    }},
 426  }}
 27}

Methods/Properties

detect