1
0
mirror of https://github.com/securego/gosec.git synced 2025-07-17 01:12:33 +02:00

Migrated the rule to the analyzers folder

This commit is contained in:
Dimitar Banchev
2024-08-29 17:40:14 +02:00
committed by Cosmin Cojocar
parent 3f6e1e7326
commit a26215cf23
6 changed files with 350 additions and 137 deletions

View File

@ -35,6 +35,15 @@ type SSAAnalyzerResult struct {
SSA *buildssa.SSA
}
// BuildDefaultAnalyzers returns the default list of analyzers
func BuildDefaultAnalyzers() []*analysis.Analyzer {
return []*analysis.Analyzer{
newConversionOverflowAnalyzer("G115", "Type conversion which leads to integer overflow"),
newSliceBoundsAnalyzer("G602", "Possible slice bounds out of range"),
newHardCodedNonce("G407", "Use of hardcoded IV/nonce for encryption"),
}
}
// getSSAResult retrieves the SSA result from analysis pass
func getSSAResult(pass *analysis.Pass) (*SSAAnalyzerResult, error) {
result, ok := pass.ResultOf[buildssa.Analyzer]