Documentation ¶
Index ¶
- Constants
- Variables
- func DetectConstErrorDeclaration(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectCycle(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectDeferIssues(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectDeprecatedFunctions(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectEarlyReturnOpportunities(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectEmitFormat(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectGnoPackageImports(filename string, severity tt.Severity) ([]tt.Issue, error)
- func DetectHighCyclomaticComplexity(filename string, threshold int, severity tt.Severity) ([]tt.Issue, error)
- func DetectLoopAllocation(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectMissingModPackage(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectRepeatedRegexCompilation(filename string, node *ast.File, severity tt.Severity) ([]tt.Issue, error)
- func DetectSliceBoundCheck(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectUnnecessaryConversions(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectUnnecessarySliceLength(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func DetectUselessBreak(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
- func ParseFile(filename string, content []byte) (*ast.File, *token.FileSet, error)
- func RemoveUnnecessaryElse(snippet string) (string, error)
- func RunGolangciLint(filename string, severity tt.Severity) ([]tt.Issue, error)
- type DeferChecker
- type Dependencies
- type Dependency
Constants ¶
View Source
const ( GNO_PKG_PREFIX = "gno.land/" GNO_STD_PACKAGE = "std" )
Variables ¶
View Source
var RepeatedRegexCompilationAnalyzer = &analysis.Analyzer{
Name: "repeatedregexcompilation",
Doc: "Checks for repeated compilation of the same regex pattern",
Run: runRepeatedRegexCompilation,
}
Functions ¶
func DetectCycle ¶
func DetectDeferIssues ¶
func DetectEarlyReturnOpportunities ¶
func DetectEarlyReturnOpportunities(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
DetectEarlyReturnOpportunities detects if-else chains that can be simplified using early returns. This rule considers an else block unnecessary if the if block ends with a return statement. In such cases, the else block can be removed and the code can be flattened to improve readability.
func DetectEmitFormat ¶
func DetectGnoPackageImports ¶
func DetectLoopAllocation ¶
func DetectMissingModPackage ¶
func DetectSliceBoundCheck ¶
func DetectSliceBoundCheck(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
TODO: Make more precisely.
func DetectUselessBreak ¶
func DetectUselessBreak(filename string, node *ast.File, fset *token.FileSet, severity tt.Severity) ([]tt.Issue, error)
DetectUselessBreak detects useless break statements in switch or select statements.
func RemoveUnnecessaryElse ¶
Types ¶
type DeferChecker ¶
type DeferChecker struct {
// contains filtered or unexported fields
}
func NewDeferChecker ¶
type Dependencies ¶
type Dependencies map[string]*Dependency
Source Files ¶
- const_error_decl.go
- cyclomatic_complexity.go
- default_golangci.go
- defers.go
- deprecate_func.go
- detect_cycles.go
- early_return.go
- format_emit.go
- gno_analyzer.go
- loop_allocation.go
- missing_package_mod.go
- repeated_regex_compilation.go
- simplify_slice_expr.go
- slice_bound.go
- unncessary_type_conversion.go
- useless_break.go
Click to show internal directories.
Click to hide internal directories.