rules

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfidenceHigh   = 0.95
	ConfidenceMedium = 0.75
	ConfidenceLow    = 0.60
)

Confidence tiers classify rule detection precision.

Tier 3 (high): structural checks where the parsed source or resource shape leaves little room for false positives.

Tier 2 (medium): heuristic checks, including manifest attribute/resource checks and pattern matching that can occasionally depend on project context.

Tier 1 (low): rules that need type information or broader cross-file context and may produce false positives when that context is incomplete.

View Source
const AndroidDepResources = AndroidDepValues
View Source
const JavaLanguageSupportKey = "java"

Variables

View Source
var DefaultIgnoreAnnotated = []string{

	"Composable",
	"androidx.compose.runtime.Composable",

	"Preview",
	"androidx.compose.ui.tooling.preview.Preview",
	"androidx.compose.desktop.ui.tooling.preview.Preview",
}

DefaultIgnoreAnnotated is the default set of annotations whose presence causes a rule to skip the annotated declaration.

These are safe to include unconditionally — if a project doesn't use Compose or Android, these annotations won't appear and there's zero impact.

View Source
var DefaultInactive = map[string]bool{}

DefaultInactive lists rules that are inactive by default (opt-in). DefaultInactive rules are off by default (opt-in). Users enable them via config or --all-rules.

The initial contents are computed from every rule's Meta() descriptor via AllMetaProviders(), so this file does not carry a hand-maintained map. Adding a new opt-in rule requires setting DefaultActive=false in the descriptor.

Population is lazy (via ensureDefaultInactive) because the initializer happens at package-init time, which races against the rule-package init() blocks that call api.Register. A sync.Once+init() hook populates the map after all rule init() functions complete.

ApplyConfig mutates this map at runtime to reflect YAML overrides.

View Source
var DefaultMagicNumberIgnoreAnnotated = []string{
	"Preview",
	"androidx.compose.ui.tooling.preview.Preview",
	"androidx.compose.desktop.ui.tooling.preview.Preview",
}

DefaultMagicNumberIgnoreAnnotated is the set of annotations inside which magic numbers are acceptable (preview functions have hardcoded dimensions, etc.)

View Source
var DefaultUnusedMemberIgnoreAnnotated = []string{
	"Preview",
	"androidx.compose.ui.tooling.preview.Preview",
	"androidx.compose.desktop.ui.tooling.preview.Preview",
	"Composable",
}

DefaultUnusedMemberIgnoreAnnotated is the set of annotations that mark members as used by the framework (not dead code even if unreferenced in code).

Functions

func ActiveRulesV2

func ActiveRulesV2(disabledSet, enabledSet map[string]bool, allRules, experimental bool) []*api.Rule

ActiveRulesV2 filters api.Registry using config-driven activation.

A rule is included when it is not in disabledSet AND either:

  • it is named in enabledSet (explicit user opt-in always wins);
  • allRules=true (--all-rules);
  • experimental=true and the rule's Maturity is MaturityExperimental; OR
  • it is default-active (IsDefaultActive).

Deprecated rules are never included via allRules or experimental — the only path that re-enables a deprecated rule is naming it explicitly in enabledSet. This keeps deprecated rules from coming back to life when users flip broad opt-in flags.

func AllDeprecations

func AllDeprecations() map[string]api.Deprecation

AllDeprecations returns a snapshot of every registered rule's Deprecation metadata, keyed by rule ID. Rules without a Deprecation are omitted; the result is nil when no rule is deprecated.

The returned map and its values are not shared with the registry — the deprecation pointer is copied so callers can read it without holding a reference to a registered rule.

func AllMetaProviders

func AllMetaProviders() []api.MetaProvider

AllMetaProviders returns a zero-value pointer for every rule struct that declares Meta(). The slice is used to build a name- indexed metaByName map without depending on Registry entries (which may be v2 adapter wrappers whose concrete struct is not reachable via Unwrap).

func AllSuppressionAliases

func AllSuppressionAliases() map[string][]string

AllSuppressionAliases returns a snapshot of every rule's suppression aliases, keyed by canonical rule ID. The pipeline Parse phase passes this into scanner.SuppressionFilter.WithRuleAliases so an @Suppress("LegacyName") (or `// krit:ignore[LegacyName]`) silences findings emitted under the canonical ID.

Returns a nil map when no registered rule declares any aliases. The scanner side treats nil and empty equivalently, so a nil result is a safe drop-in.

func ApplyConfig

func ApplyConfig(cfg *config.Config)

ApplyConfig applies YAML configuration to all registered rules.

Semantics are owned by the checked-in rule descriptors:

  • ruleset-level `active: false` short-circuits and marks every rule in the set inactive regardless of rule-level overrides
  • rule-level `active: true|false` overrides DefaultInactive
  • per-rule `excludes` lists a set of config-compatible file globs
  • every configured option on the rule's Meta() descriptor is applied to the concrete struct via its descriptor Apply closure

The single source of truth for rule metadata is MetaForRule(), which reads Meta() from the registered concrete rule when available and falls back to the metaByName index for rules without a concrete config target.

func BuildOracleCallTargetFilterV2

func BuildOracleCallTargetFilterV2(enabled []*api.Rule) oracle.CallTargetFilterSummary

BuildOracleCallTargetFilterV2 unions the call-target interest declared by active rules. If any enabled oracle rule declares AllCalls, the returned summary is disabled and callers must resolve every call. Rules with nil OracleCallTargets are treated as non-consumers of LookupCallTarget and do not contribute to the union.

func BuildOracleCallTargetFilterV2ForFiles

func BuildOracleCallTargetFilterV2ForFiles(enabled []*api.Rule, files []*scanner.File) oracle.CallTargetFilterSummary

BuildOracleCallTargetFilterV2ForFiles is BuildOracleCallTargetFilterV2 plus source-derived callee names for rules that declare OracleCallTargetFilter.AnnotatedIdentifiers. If those rules are evaluated without source files, the function conservatively disables filtering so the JVM preserves broad LookupCallTarget behavior.

func BuildOracleDeclarationProfileV2

func BuildOracleDeclarationProfileV2(enabled []*api.Rule) oracle.DeclarationProfileSummary

BuildOracleDeclarationProfileV2 derives the declaration-export profile for a set of active rules. The result is the union of every oracle-needing rule's OracleDeclarationNeeds declaration combined with the implications of its narrow NeedsOracle* bits.

A rule that declares the umbrella NeedsOracle (every narrow bit) forces the full profile — we cannot tell which declaration fields it reads. Rules that declare narrow bits contribute only the declaration fields those bits imply.

func BuildOracleFilterRulesV2

func BuildOracleFilterRulesV2(enabled []*api.Rule) []oracle.FilterRule

BuildOracleFilterRulesV2 converts the subset of v2 rules that need the Kotlin oracle into the minimal OracleFilterRule representation consumed by oracle.CollectOracleFiles.

Inversion semantics (roadmap/core-infra/oracle-filter-inversion.md): rules that do NOT need the oracle are excluded from oracle selection entirely — the oracle is only invoked on files an oracle-needing rule asked for. A rule that needs the oracle with no Oracle filter set (or an AllFiles: true filter) is treated as wanting every file.

func CheckConvertToWebp

func CheckConvertToWebp(idx *android.IconIndex, c *scanner.FindingCollector)

CheckConvertToWebp reports large PNG files that could be converted to WebP.

func CheckGifUsage

func CheckGifUsage(idx *android.IconIndex, c *scanner.FindingCollector)

CheckGifUsage reports any GIF files in the resource directories.

func CheckIconColors

func CheckIconColors(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconColors checks that notification and action bar icons use the same color constraints as Android lint's IconColors detector.

func CheckIconColorsWithFacts

func CheckIconColorsWithFacts(idx *android.IconIndex, c *scanner.FindingCollector, facts *librarymodel.Facts)

CheckIconColorsWithFacts checks IconColors using project SDK facts when the Android pipeline has Gradle-derived profile data available.

func CheckIconDensities

func CheckIconDensities(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconDensities reports icons that exist in some densities but not others.

func CheckIconDipSize

func CheckIconDipSize(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconDipSize reports icons whose dimensions don't match expected DPI ratios.

func CheckIconDuplicates

func CheckIconDuplicates(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconDuplicates reports icons that are identical across densities (same hash).

func CheckIconDuplicatesConfig

func CheckIconDuplicatesConfig(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconDuplicatesConfig reports identical icons across different configuration folders (e.g., drawable-en and drawable-fr). Icons with the same hash in different config folders are wasteful duplicates.

func CheckIconExpectedSize

func CheckIconExpectedSize(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconExpectedSize reports launcher icons that are not at the expected size for their density.

func CheckIconExtension

func CheckIconExtension(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconExtension reports icon files where the file extension doesn't match the detected content format.

func CheckIconLauncherShape

func CheckIconLauncherShape(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconLauncherShape checks launcher icon PNGs for transparent corners, which may indicate a non-adaptive icon format. Adaptive icons should fill the entire canvas without transparent corners.

func CheckIconLocation

func CheckIconLocation(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconLocation reports launcher icons placed in drawable-* folders instead of mipmap-*.

func CheckIconMissingDensityFolder

func CheckIconMissingDensityFolder(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconMissingDensityFolder reports when standard density folders are missing entirely. It requires that at least one drawable-* or mipmap-* folder exists.

func CheckIconMixedNinePatch

func CheckIconMixedNinePatch(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconMixedNinePatch reports icons that have a mix of nine-patch (.9.png) and non-nine-patch variants.

func CheckIconNoDpi

func CheckIconNoDpi(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconNoDpi reports icons that appear in both drawable-nodpi and a density-specific folder. An icon in nodpi should not also exist in a density-specific folder, as the density variant will shadow the nodpi one.

func CheckIconXMLAndPng

func CheckIconXMLAndPng(idx *android.IconIndex, c *scanner.FindingCollector)

CheckIconXMLAndPng reports resources that exist as both XML vector and raster (PNG/JPG/WebP) formats.

func DeprecationFor

func DeprecationFor(ruleID string) (*api.Deprecation, bool)

DeprecationFor returns the deprecation metadata for a rule, or (nil, false) if the rule is not deprecated or is unknown.

Consumers (output formatters, CI gates, the docs generator) call this to surface ReplacedBy / Reason guidance when a deprecated rule is active.

func GetAllRuleExcludes

func GetAllRuleExcludes() map[string][]string

GetAllRuleExcludes returns a snapshot of every rule's exclude globs, omitting rules with an empty pattern list. The pipeline Parse phase passes this into scanner.BuildSuppressionFilter so the exclude globs live on each file's filter rather than being reconsulted per rule/file combination by the dispatcher.

func GetRuleExcludes

func GetRuleExcludes(ruleName string) []string

GetRuleExcludes returns the glob patterns for file exclusion for a rule.

func HasIgnoredAnnotation

func HasIgnoredAnnotation(text string, ignoredAnnotations []string) bool

HasIgnoredAnnotation checks if a declaration text contains any of the ignored annotations. Matches both simple names and fully-qualified names.

func HasV2Implementation

func HasV2Implementation(r *api.Rule) bool

HasV2Implementation reports whether a rule has both executable analysis logic and a declared dispatcher route.

func IsDefaultActive

func IsDefaultActive(name string) bool

IsDefaultActive returns whether a rule is active by default.

func IsDeprecated

func IsDeprecated(name string) bool

IsDeprecated reports whether a rule's Maturity is MaturityDeprecated. Returns false for stable, experimental, or unknown rule IDs.

func IsExperimental

func IsExperimental(name string) bool

IsExperimental reports whether a rule's Maturity is MaturityExperimental. Returns false for stable, deprecated, or unknown rule IDs.

func IsFileExcluded

func IsFileExcluded(filePath string, excludes []string) bool

IsFileExcluded checks whether a file path matches any of the rule's exclude patterns.

func JavaSupportForRule

func JavaSupportForRule(r *api.Rule) (api.LanguageSupport, bool)

JavaSupportForRule returns the per-rule Java support entry, falling back to the rule's ruleset default when there is no rule-specific override.

func KotlinOracleRulesV2

func KotlinOracleRulesV2(enabled []*api.Rule) []*api.Rule

KotlinOracleRulesV2 returns the active subset that should contribute to KAA file selection, call-target filtering, declaration export, and diagnostics.

func MetaForRule

func MetaForRule(r *api.Rule) (api.RuleDescriptor, bool)

MetaForRule returns the RuleDescriptor for a rule.

Every registered rule has a descriptor: ID, RuleSet, Severity, Description, and Confidence are taken from r (the registry is the source of truth for those). The remaining fields (DefaultActive, FixLevel, Options, CustomApply, LanguageSupport) are read directly from r when populated, otherwise from the rule's optional MetaProvider implementation, otherwise from the metaByName index. The dual path supports the in-progress migration from per-rule Meta() methods to descriptor fields on api.Rule itself; once every rule has migrated, the MetaProvider fallback can be deleted.

Returns (zero, false) only when r is nil — every non-nil registered rule yields a descriptor.

func NeedsOracleDeclarationWalk

func NeedsOracleDeclarationWalk(enabled []*api.Rule) bool

NeedsOracleDeclarationWalk reports whether any active rule consumes a fact that requires the JVM-side declaration walk (members, signatures, supertypes, class/member annotations). When false, krit-types can skip declaration extraction entirely.

func NeedsOracleDiagnostics

func NeedsOracleDiagnostics(enabled []*api.Rule) bool

NeedsOracleDiagnostics reports whether active rules should request expensive compiler diagnostics from krit-types. Driven by the OracleFactUnion: a rule must declare NeedsOracleDiagnostics (or the umbrella NeedsOracle) to opt in.

func NeedsOracleLibraryClasses

func NeedsOracleLibraryClasses(enabled []*api.Rule) bool

NeedsOracleLibraryClasses reports whether any active rule needs the JAR / library closure (Dependencies map). When false, krit-types can skip the library walk.

func OracleCallTargetFilterNeedsFiles

func OracleCallTargetFilterNeedsFiles(enabled []*api.Rule) bool

OracleCallTargetFilterNeedsFiles reports whether any active rule asks the call-target filter to derive lexical callee names from source files.

func OracleFactUnion

func OracleFactUnion(enabled []*api.Rule) api.Capabilities

OracleFactUnion returns the OR of NeedsOracle* bits across the active rule set. This is the single place rule descriptors are translated into the JVM workload mask consumed by InvocationOptions: rules opt into specific KAA fact categories (call targets, suspend markers, supertypes, members, diagnostics, library closure) and the pipeline's --no-diagnostics / --declaration-profile flags follow.

func RuleNeedsKotlinOracle

func RuleNeedsKotlinOracle(r *api.Rule) bool

RuleNeedsKotlinOracle reports whether a rule is an actual KAA consumer. The narrow NeedsOracle* bits (or the umbrella alias) are the single source of truth — rules must declare the fact categories they consume so the bridge can compute a tight workload union.

NeedsTypeInfo is intentionally not enough: it is resolver-only source type information. A rule with OracleCallTargets or OracleDeclarationNeeds but no NeedsOracle* bit is a registration error caught by TestOracleBitsMatchMetadata.

func RuleScope

func RuleScope(r *api.Rule) api.Scope

RuleScope returns the dispatcher bucket a rule lands in. When the rule sets r.Scope explicitly that value is honoured; otherwise the scope is derived from the rule's Capabilities and NodeTypes. The derivation matches the historical classifier ordering and is the authoritative mapping until every registration sets Scope explicitly.

func SetReporter

func SetReporter(r *diag.Reporter)

SetReporter installs r as the package-level Reporter for diagnostic output (rule-panic stack traces, malformed-config warnings) emitted by the rules package. Passing nil restores a default warnings-only Reporter.

func SetRuleExcludes

func SetRuleExcludes(ruleName string, patterns []string)

SetRuleExcludes sets glob patterns for file exclusion on a rule by name.

func SetRuleProfileLabels

func SetRuleProfileLabels(enabled bool) func()

SetRuleProfileLabels enables pprof labels around individual rule callbacks. It returns a restore function so tests or embedded callers can scope the setting. The CLI enables this while --cpuprofile is active so pprof can rank samples by krit_rule / krit_rule_family labels.

func SortByRunAfter

func SortByRunAfter(rules []*api.Rule) []*api.Rule

SortByRunAfter returns rules reordered so each rule's RunAfter dependencies precede it. The sort is stable: rules that are unrelated to any dependency keep their original relative order. Nil entries are dropped (the dispatcher already filters them).

Dependencies that are not present in rules are silently ignored — a rule can declare RunAfter on a constraint that only applies in some rule sets without becoming a hard requirement.

A cycle among active rules is a programmer error. SortByRunAfter panics with the cycle's rule IDs so the offending registration shows up in tests rather than as a silent runtime drift.

func SortDispatchErrors added in v0.2.0

func SortDispatchErrors(errs []DispatchError)

SortDispatchErrors orders errors by (FilePath, Line, RuleName, PanicValue string) so that error emission has a stable cross-run ordering regardless of which goroutine recovered each panic first.

Callers in pipeline phases (dispatch, crossfile, etc.) MUST invoke this before emitting `[]DispatchError` to a Reporter or returning it across a phase boundary — see issues #28 and #29. The helper lives in this package so every dispatch-error producer can reach it without re-deriving the comparator.

Types

type AbsentOrWrongFileLicenseRule

type AbsentOrWrongFileLicenseRule struct {
	LineBase
	BaseRule
	LicenseTemplate string
	IsRegex         bool
	// contains filtered or unexported fields
}

AbsentOrWrongFileLicenseRule checks that the first comment matches a license template.

func (*AbsentOrWrongFileLicenseRule) Confidence

func (r *AbsentOrWrongFileLicenseRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*AbsentOrWrongFileLicenseRule) IsFixable

func (r *AbsentOrWrongFileLicenseRule) IsFixable() bool

Comments fixable rules (batch 2)

func (*AbsentOrWrongFileLicenseRule) Meta

type AbstractClassCanBeConcreteClassRule

type AbstractClassCanBeConcreteClassRule struct {
	FlatDispatchBase
	BaseRule
}

AbstractClassCanBeConcreteClassRule detects abstract classes with no abstract members. With type inference: also checks inherited abstract members via ClassHierarchy to avoid false positives when abstract members come from a supertype.

func (*AbstractClassCanBeConcreteClassRule) Confidence

Confidence reports a tier-2 (medium) base confidence — classifying abstractness requires knowing all concrete method bodies; resolver-assisted but falls back to structural heuristic. Classified per roadmap/17.

func (*AbstractClassCanBeConcreteClassRule) IsFixable

func (*AbstractClassCanBeConcreteClassRule) Meta

type AbstractClassCanBeInterfaceRule

type AbstractClassCanBeInterfaceRule struct {
	FlatDispatchBase
	BaseRule
}

AbstractClassCanBeInterfaceRule detects abstract classes with no state.

func (*AbstractClassCanBeInterfaceRule) Confidence

func (r *AbstractClassCanBeInterfaceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/classes rule. Detection relies on modifier and declaration structure plus (optional) resolver-backed inheritance checks; the fallback path is heuristic. Classified per roadmap/17.

func (*AbstractClassCanBeInterfaceRule) IsFixable

func (r *AbstractClassCanBeInterfaceRule) IsFixable() bool

func (*AbstractClassCanBeInterfaceRule) Meta

type AbstractMemberNotImplementedRule added in v0.2.0

type AbstractMemberNotImplementedRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- AbstractMemberNotImplementedRule — flags concrete classes that fail to implement at least one abstract member declared on a supertype the resolver can see. Mimics kotlinc's ABSTRACT_MEMBER_NOT_IMPLEMENTED for the source-resolvable case: same-workspace interfaces and abstract classes whose abstract members the subclass omitted.

Scope:

  • Interfaces, sealed interfaces, abstract classes, and expect/external declarations are skipped (they don't have to implement anything).
  • For interface supertypes, all function members are treated as abstract for v1. Default-method interfaces (rare in Kotlin) will false-positive against this rule until member-body presence is tracked on MemberInfo.
  • For non-interface supertypes, only members with the explicit `abstract` modifier are required.
  • Walks one level of supertypes. Transitive abstract requirements (X : AbstractA : InterfaceB) are deferred.
  • Implementations include same-named members in the class body and `override val/var` properties declared in the primary constructor.

---------------------------------------------------------------------------

func (*AbstractMemberNotImplementedRule) Confidence added in v0.2.0

func (r *AbstractMemberNotImplementedRule) Confidence() float64

type AccidentalOctalRule

type AccidentalOctalRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*AccidentalOctalRule) Confidence

func (r *AccidentalOctalRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*AccidentalOctalRule) Meta

type AdMobInitializedBeforeConsentRule

type AdMobInitializedBeforeConsentRule struct {
	FlatDispatchBase
	BaseRule
}

AdMobInitializedBeforeConsentRule flags MobileAds.initialize(...) inside an Application.onCreate override when no earlier consent update call is present.

func (*AdMobInitializedBeforeConsentRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Privacy/permissions rule. Detection pattern-matches sensitive API call shapes and annotation names without cross-checking project permission contracts. Classified per roadmap/17.

func (*AdMobInitializedBeforeConsentRule) Meta

type AdapterViewChildrenResourceRule

type AdapterViewChildrenResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

AdapterViewChildrenResourceRule detects AdapterView subclasses (ListView, GridView, Spinner, Gallery, ExpandableListView) with direct children in XML. These views populate children from an adapter; XML children are invalid.

func (*AdapterViewChildrenResourceRule) Confidence

func (r *AdapterViewChildrenResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*AdapterViewChildrenResourceRule) Meta

type AddJavascriptInterfaceRule

type AddJavascriptInterfaceRule struct {
	FlatDispatchBase
	AndroidRule
}

AddJavascriptInterfaceRule detects WebView.addJavascriptInterface() calls.

func (*AddJavascriptInterfaceRule) Meta

type AllProjectsBlockRule

type AllProjectsBlockRule struct {
	FlatDispatchBase
	BaseRule
}

AllProjectsBlockRule flags deprecated allprojects { } usage in Gradle build scripts. Convention plugins or settings-level repositories are the recommended replacement.

func (*AllProjectsBlockRule) Confidence

func (r *AllProjectsBlockRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Release-engineering rule. Detection scans module metadata and Gradle files for configuration drift and plugin hygiene; matches are project-structure-sensitive. Classified per roadmap/17.

func (*AllProjectsBlockRule) Meta

type AllowAllHostnameVerifierRule

type AllowAllHostnameVerifierRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*AllowAllHostnameVerifierRule) Confidence

func (r *AllowAllHostnameVerifierRule) Confidence() float64

func (*AllowAllHostnameVerifierRule) Meta

type AllowBackupManifestRule

type AllowBackupManifestRule struct {
	ManifestBase
	AndroidRule
}

AllowBackupManifestRule checks for android:allowBackup="true" in <application>. When allowBackup is true (or unset, which defaults to true), app data can be backed up and restored via adb, which has security implications.

func (*AllowBackupManifestRule) Meta

type AlsoCouldBeApplyRule

type AlsoCouldBeApplyRule struct {
	FlatDispatchBase
	BaseRule
}

func (*AlsoCouldBeApplyRule) Confidence

func (r *AlsoCouldBeApplyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*AlsoCouldBeApplyRule) IsFixable

func (r *AlsoCouldBeApplyRule) IsFixable() bool

Style2 fixable rules AlsoCouldBeApply: `.also { }` → `.apply { }` swap rewrites the scope-function name and strips the `it.` receiver prefix from each statement. The fix bails when `it` appears outside a leading receiver position to avoid leaving unbound references behind.

func (*AlsoCouldBeApplyRule) Meta

type AlwaysShowActionResourceRule

type AlwaysShowActionResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

AlwaysShowActionResourceRule detects showAsAction="always" in menu or layout XML. Using "always" can crowd the action bar on small screens. Prefer "ifRoom" to let the system decide.

func (*AlwaysShowActionResourceRule) Confidence

func (r *AlwaysShowActionResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*AlwaysShowActionResourceRule) Meta

type AnalyticsCallWithoutConsentGateRule

type AnalyticsCallWithoutConsentGateRule struct {
	FlatDispatchBase
	BaseRule
}

AnalyticsCallWithoutConsentGateRule flags analytics event calls that are not guarded by a consent/privacy/GDPR check.

func (*AnalyticsCallWithoutConsentGateRule) Confidence

func (*AnalyticsCallWithoutConsentGateRule) Meta

type AnalyticsEventWithPiiParamNameRule

type AnalyticsEventWithPiiParamNameRule struct {
	FlatDispatchBase
	BaseRule
}

AnalyticsEventWithPiiParamNameRule flags analytics event calls whose bundle argument includes a key matching PII patterns like email, phone, ssn.

func (*AnalyticsEventWithPiiParamNameRule) Confidence

func (*AnalyticsEventWithPiiParamNameRule) Meta

type AnalyticsUserIDFromPiiRule

type AnalyticsUserIDFromPiiRule struct {
	FlatDispatchBase
	BaseRule
}

AnalyticsUserIDFromPiiRule flags calls to user-ID setters whose argument is a property named email, phoneNumber, username, etc.

func (*AnalyticsUserIDFromPiiRule) Confidence

func (r *AnalyticsUserIDFromPiiRule) Confidence() float64

func (*AnalyticsUserIDFromPiiRule) Meta

type AndroidDataDependency

type AndroidDataDependency uint32

AndroidDataDependency describes which Android project data a rule needs.

const (
	AndroidDepNone     AndroidDataDependency = 0
	AndroidDepManifest AndroidDataDependency = 1 << iota
	AndroidDepLayout
	AndroidDepIcons
	AndroidDepGradle
	AndroidDepValuesStrings
	AndroidDepValuesDimensions
	AndroidDepValuesPlurals
	AndroidDepValuesArrays
	AndroidDepValuesExtraText
)

type AndroidGradlePluginVersionRule

type AndroidGradlePluginVersionRule struct {
	GradleBase
	AndroidRule
}

AndroidGradlePluginVersionRule flags AGP versions older than 7.0, which are no longer supported and may be missing critical fixes.

func (*AndroidGradlePluginVersionRule) Confidence

func (r *AndroidGradlePluginVersionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*AndroidGradlePluginVersionRule) Meta

type AndroidLintCategory

type AndroidLintCategory string

AndroidLintCategory represents the AOSP lint category.

const (
	ALCCorrectness   AndroidLintCategory = "correctness"
	ALCSecurity      AndroidLintCategory = "security"
	ALCPerformance   AndroidLintCategory = "performance"
	ALCUsability     AndroidLintCategory = "usability"
	ALCAccessibility AndroidLintCategory = "accessibility"
	ALCI18N          AndroidLintCategory = "i18n"
	ALCIcons         AndroidLintCategory = "icons"
	ALCMessages      AndroidLintCategory = "messages"
	ALCUnknown       AndroidLintCategory = "unknown"
)
const (
	ALCRTL AndroidLintCategory = "rtl"
)

Additional category constants not in android.go

type AndroidLintSeverity

type AndroidLintSeverity string

AndroidLintSeverity maps to AOSP severity levels.

const (
	ALSFatal         AndroidLintSeverity = "fatal"
	ALSError         AndroidLintSeverity = "error"
	ALSWarning       AndroidLintSeverity = "warning"
	ALSInformational AndroidLintSeverity = "informational"
)

type AndroidRule

type AndroidRule struct {
	BaseRule
	IssueID    string              // Original AOSP issue ID (e.g., "ContentDescription")
	Brief      string              // Original brief description
	Category   AndroidLintCategory // AOSP category
	ALSeverity AndroidLintSeverity // AOSP severity
	Priority   int                 // AOSP priority (1-10)
	Origin     string              // Always "AOSP Android Lint"
}

AndroidRule is the base for all Android lint rules ported from AOSP.

func (AndroidRule) Description

func (r AndroidRule) Description() string

Description returns the Brief string for Android rules (which all carry one from their AOSP origin), falling back to the embedded BaseRule.Desc.

type AnimatorDurationIgnoresScaleRule

type AnimatorDurationIgnoresScaleRule struct {
	FlatDispatchBase
	BaseRule
}

AnimatorDurationIgnoresScaleRule flags animator durations that ignore the system animation scale preference. This initial implementation uses a file-level opt-out on ANIMATOR_DURATION_SCALE references and targets the common ValueAnimator/ObjectAnimator call patterns in fixtures.

func (*AnimatorDurationIgnoresScaleRule) Confidence

func (r *AnimatorDurationIgnoresScaleRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Accessibility rule. Detection matches on Compose/View API call shapes and argument labels by name rather than by resolved type. Classified per roadmap/17.

func (*AnimatorDurationIgnoresScaleRule) Meta

type AnvilContributesBindingWithoutScopeRule

type AnvilContributesBindingWithoutScopeRule struct {
	FlatDispatchBase
	BaseRule
}

AnvilContributesBindingWithoutScopeRule detects a same-file mismatch between @ContributesBinding(scope) and the @ContributesTo(scope) on the bound interface.

func (*AnvilContributesBindingWithoutScopeRule) Confidence

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule. Detection uses annotation and import patterns for Dagger/Hilt/Anvil; project-specific DI aliases are not followed. Classified per roadmap/17.

func (*AnvilContributesBindingWithoutScopeRule) Meta

type AnvilMergeComponentEmptyScopeRule

type AnvilMergeComponentEmptyScopeRule struct {
	FlatDispatchBase
	BaseRule
}

AnvilMergeComponentEmptyScopeRule detects @MergeComponent scopes that have no matching @ContributesTo/@ContributesBinding declarations anywhere in the project.

func (*AnvilMergeComponentEmptyScopeRule) Confidence

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule. Detection uses annotation and import patterns for Dagger/Hilt/Anvil; project-specific DI aliases are not followed. Classified per roadmap/17.

func (*AnvilMergeComponentEmptyScopeRule) Meta

type AppCompatMethodRule

type AppCompatMethodRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*AppCompatMethodRule) Confidence

func (r *AppCompatMethodRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*AppCompatMethodRule) Meta

type AppCompatResourceRule

type AppCompatResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

AppCompatResourceRule detects menu items using android:showAsAction instead of app:showAsAction. When using AppCompat, the app: namespace is required.

func (*AppCompatResourceRule) Confidence

func (r *AppCompatResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*AppCompatResourceRule) Meta

type AppIndexingErrorManifestRule

type AppIndexingErrorManifestRule struct {
	ManifestBase
	AndroidRule
}

AppIndexingErrorManifestRule detects activities with a VIEW intent filter that are missing HTTP or HTTPS data schemes. Activities handling VIEW actions should typically support deep linking via http/https.

func (*AppIndexingErrorManifestRule) Meta

type AppIndexingWarningManifestRule

type AppIndexingWarningManifestRule struct {
	ManifestBase
	AndroidRule
}

AppIndexingWarningManifestRule detects activities with browsable intent filters that are missing a VIEW action. Activities with the BROWSABLE category should typically also declare a VIEW action for proper deep link handling.

func (*AppIndexingWarningManifestRule) Meta

type ApplyPluginTwiceRule

type ApplyPluginTwiceRule struct {
	GradleBase
	BaseRule
}

func (*ApplyPluginTwiceRule) Confidence

func (r *ApplyPluginTwiceRule) Confidence() float64

func (*ApplyPluginTwiceRule) Meta

type ArrayPrimitiveRule

type ArrayPrimitiveRule struct {
	FlatDispatchBase
	BaseRule
}

ArrayPrimitiveRule detects Array<Int> etc. instead of IntArray. With type inference: verifies the type argument resolves to a primitive type via ResolveImport, catching aliased or re-imported primitives.

func (*ArrayPrimitiveRule) Confidence

func (r *ArrayPrimitiveRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — detects Array<Int>/Array<Long> that should be IntArray/LongArray; needs resolver for generic receivers, falls back to text match. Classified per roadmap/17.

func (*ArrayPrimitiveRule) IsFixable

func (r *ArrayPrimitiveRule) IsFixable() bool

func (*ArrayPrimitiveRule) Meta

type AssertEqualsArgumentOrderRule

type AssertEqualsArgumentOrderRule struct {
	FlatDispatchBase
	BaseRule
}

AssertEqualsArgumentOrderRule detects assertEquals(actual, expected) when the arguments are simple identifiers named exactly "actual" and "expected". This keeps the first iteration narrow and low-noise.

func (*AssertEqualsArgumentOrderRule) Confidence

func (r *AssertEqualsArgumentOrderRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Testing-quality rule. Detection matches on assertion framework call shapes (JUnit, Truth, Kotest, MockK) by name — cross-library identifier collisions can produce false positives. Classified per roadmap/17.

func (*AssertEqualsArgumentOrderRule) Meta

type AssertNullableWithNotNullAssertionRule

type AssertNullableWithNotNullAssertionRule struct {
	FlatDispatchBase
	BaseRule
}

func (*AssertNullableWithNotNullAssertionRule) Confidence

func (*AssertNullableWithNotNullAssertionRule) Meta

type AssertRule

type AssertRule struct {
	FlatDispatchBase
	AndroidRule
}

AssertRule detects assert statements (disabled on Android).

func (*AssertRule) Confidence

func (r *AssertRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*AssertRule) Meta

func (r *AssertRule) Meta() api.RuleDescriptor

type AssertTrueOnComparisonRule

type AssertTrueOnComparisonRule struct {
	FlatDispatchBase
	BaseRule
}

AssertTrueOnComparisonRule detects assertTrue(actual == expected) and recommends assertEquals for better failure messages.

func (*AssertTrueOnComparisonRule) Confidence

func (r *AssertTrueOnComparisonRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Testing-quality rule. Detection matches receiverless assertTrue calls and known JUnit receiver qualifiers by AST shape. Classified per roadmap/17.

func (*AssertTrueOnComparisonRule) Meta

type AvoidReferentialEqualityRule

type AvoidReferentialEqualityRule struct {
	FlatDispatchBase
	BaseRule
	ForbiddenTypePatterns []string
}

AvoidReferentialEqualityRule detects === or !== usage. With type inference: only flags when operands are String (where referential equality is almost certainly a bug). Without resolver, flags all === / !==. ---------------------------------------------------------------------------

func (*AvoidReferentialEqualityRule) Confidence

func (r *AvoidReferentialEqualityRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — flags === / !== on value types; needs resolver to confirm operand types, falls back to a name-based heuristic. Classified per roadmap/17.

func (*AvoidReferentialEqualityRule) IsFixable

func (r *AvoidReferentialEqualityRule) IsFixable() bool

func (*AvoidReferentialEqualityRule) Meta

type BackButtonResourceRule

type BackButtonResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

BackButtonResourceRule detects buttons with text "Back" or "@string/back". Android uses system navigation for back; explicit back buttons are discouraged as they conflict with the platform's navigation pattern.

func (*BackButtonResourceRule) Confidence

func (r *BackButtonResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android accessibility resource rule. Detection flags missing contentDescription, importantForAccessibility, and focusable attributes via structural checks. Classified per roadmap/17.

func (*BackButtonResourceRule) Meta

type BackupRulesRule

type BackupRulesRule struct {
	ManifestBase
	AndroidRule
}

BackupRulesRule checks that the <application> element has backup configuration attributes (android:fullBackupContent or android:dataExtractionRules).

func (*BackupRulesRule) Meta

type BaseRule

type BaseRule = base.BaseRule

BaseRule, FlatDispatchBase, and LineBase live in internal/rules/base so domain rule subpackages (internal/rules/<domain>/) can embed them without importing the parent rules package. Aliases keep existing literal constructions and embeds working unchanged within this package.

type BindsInsteadOfProvidesRule

type BindsInsteadOfProvidesRule struct {
	FlatDispatchBase
	BaseRule
}

BindsInsteadOfProvidesRule detects `@Provides` functions with a single parameter whose body simply returns that parameter unchanged. The function can be expressed as a cheaper `@Binds` abstract method.

func (*BindsInsteadOfProvidesRule) Confidence

func (r *BindsInsteadOfProvidesRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*BindsInsteadOfProvidesRule) Meta

type BindsMismatchedArityRule

type BindsMismatchedArityRule struct {
	FlatDispatchBase
	BaseRule
}

BindsMismatchedArityRule detects @Binds functions that do not declare exactly one parameter, which Dagger rejects during code generation.

func (*BindsMismatchedArityRule) Confidence

func (r *BindsMismatchedArityRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule. Detection uses annotation and import patterns for Dagger/Hilt/Anvil; project-specific DI aliases are not followed. Classified per roadmap/17.

func (*BindsMismatchedArityRule) Meta

type BindsReturnTypeMatchesParamRule

type BindsReturnTypeMatchesParamRule struct {
	FlatDispatchBase
	BaseRule
}

BindsReturnTypeMatchesParamRule detects `@Binds` functions whose parameter type equals the return type — a no-op binding that Dagger rejects.

func (*BindsReturnTypeMatchesParamRule) Confidence

func (r *BindsReturnTypeMatchesParamRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*BindsReturnTypeMatchesParamRule) Meta

type BiometricAuthNotFallingBackToDeviceCredentialRule

type BiometricAuthNotFallingBackToDeviceCredentialRule struct {
	FlatDispatchBase
	BaseRule
}

BiometricAuthNotFallingBackToDeviceCredentialRule flags direct BiometricPrompt.authenticate(...) calls whose inline PromptInfo.Builder chain never enables device credential fallback.

func (*BiometricAuthNotFallingBackToDeviceCredentialRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Privacy/permissions rule. Detection pattern-matches sensitive API call shapes and annotation names without cross-checking project permission contracts. Classified per roadmap/17.

func (*BiometricAuthNotFallingBackToDeviceCredentialRule) Meta

type BitmapDecodeWithoutOptionsRule

type BitmapDecodeWithoutOptionsRule struct {
	FlatDispatchBase
	BaseRule
}

BitmapDecodeWithoutOptionsRule detects BitmapFactory.decode* calls that omit BitmapFactory.Options, which can lead to decoding full-size bitmaps.

func (*BitmapDecodeWithoutOptionsRule) Confidence

func (r *BitmapDecodeWithoutOptionsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Performance rule. Detection pattern-matches anti-patterns (allocation in loops, primitive boxing, collection chains) with optional resolver support; fallback is heuristic. Classified per roadmap/17.

func (*BitmapDecodeWithoutOptionsRule) Meta

type BooleanPropertyNamingRule

type BooleanPropertyNamingRule struct {
	FlatDispatchBase
	BaseRule
	AllowedPattern *regexp.Regexp
}

BooleanPropertyNamingRule checks that Boolean properties start with is/has/are.

func (*BooleanPropertyNamingRule) Confidence

func (r *BooleanPropertyNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*BooleanPropertyNamingRule) IsFixable

func (r *BooleanPropertyNamingRule) IsFixable() bool

Naming fixable rules BooleanPropertyNaming: the Check() attempts a name-rewrite fix but only when a `simple_identifier` is a direct child of the property declaration, which the current tree-sitter Kotlin grammar nests under `variable_declaration`. Advertised as not-fixable until the walker handles the nesting.

func (*BooleanPropertyNamingRule) Meta

type BracesOnIfStatementsRule

type BracesOnIfStatementsRule struct {
	FlatDispatchBase
	BaseRule
	SingleLine string
	MultiLine  string
}

BracesOnIfStatementsRule enforces braces on if statements.

func (*BracesOnIfStatementsRule) Confidence

func (r *BracesOnIfStatementsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/braces rule. Detection checks AST shape for if/when/else brace presence; the preferred form is a style preference. Classified per roadmap/17.

func (*BracesOnIfStatementsRule) IsFixable

func (r *BracesOnIfStatementsRule) IsFixable() bool

Style2 fixable rules (batch 5)

func (*BracesOnIfStatementsRule) Meta

type BracesOnWhenStatementsRule

type BracesOnWhenStatementsRule struct {
	FlatDispatchBase
	BaseRule
	SingleLine string
	MultiLine  string
}

BracesOnWhenStatementsRule enforces braces on when branches.

func (*BracesOnWhenStatementsRule) Confidence

func (r *BracesOnWhenStatementsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/braces rule. Detection checks AST shape for if/when/else brace presence; the preferred form is a style preference. Classified per roadmap/17.

func (*BracesOnWhenStatementsRule) IsFixable

func (r *BracesOnWhenStatementsRule) IsFixable() bool

func (*BracesOnWhenStatementsRule) Meta

type BroadcastReceiverExportedFlagMissingRule

type BroadcastReceiverExportedFlagMissingRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*BroadcastReceiverExportedFlagMissingRule) Confidence

func (*BroadcastReceiverExportedFlagMissingRule) Meta

type BufferedReadWithoutBufferRule

type BufferedReadWithoutBufferRule struct {
	FlatDispatchBase
	BaseRule
}

BufferedReadWithoutBufferRule detects FileInputStream.read(ByteArray(N)) where N < 8192 without wrapping in BufferedInputStream.

func (*BufferedReadWithoutBufferRule) Confidence

func (r *BufferedReadWithoutBufferRule) Confidence() float64

func (*BufferedReadWithoutBufferRule) Meta

type BuildConfigDebugInLibraryRule

type BuildConfigDebugInLibraryRule struct {
	FlatDispatchBase
	BaseRule
}

BuildConfigDebugInLibraryRule flags BuildConfig.DEBUG references inside Android library modules, where the merged consumer BuildConfig sets DEBUG to false in release builds.

func (*BuildConfigDebugInLibraryRule) Confidence

func (r *BuildConfigDebugInLibraryRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Release-engineering rule. Detection scans module metadata and Gradle files for configuration drift and plugin hygiene; matches are project-structure-sensitive. Classified per roadmap/17.

func (*BuildConfigDebugInLibraryRule) Meta

type BuildConfigDebugInvertedRule

type BuildConfigDebugInvertedRule struct {
	FlatDispatchBase
	BaseRule
}

BuildConfigDebugInvertedRule flags `if (!BuildConfig.DEBUG) { ...logging... }` patterns where debug-only logging appears to be guarded in the opposite direction.

func (*BuildConfigDebugInvertedRule) Confidence

func (r *BuildConfigDebugInvertedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Release-engineering rule. Detection scans module metadata and Gradle files for configuration drift and plugin hygiene; matches are project-structure-sensitive. Classified per roadmap/17.

func (*BuildConfigDebugInvertedRule) Meta

type ButtonCaseResourceRule

type ButtonCaseResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

ButtonCaseResourceRule detects OK/Cancel buttons with wrong capitalization. On Android, button text should be "OK" (not "Ok"/"ok") and "CANCEL" (not "Cancel"/"cancel") when using hardcoded text instead of string resources.

func (*ButtonCaseResourceRule) Confidence

func (r *ButtonCaseResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android accessibility resource rule. Detection flags missing contentDescription, importantForAccessibility, and focusable attributes via structural checks. Classified per roadmap/17.

func (*ButtonCaseResourceRule) Meta

type ButtonOrderResourceRule

type ButtonOrderResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

ButtonOrderResourceRule checks that in dialog layouts, the OK/confirm button appears after the Cancel/dismiss button. Android design guidelines place the positive action on the right (higher line number in layout).

func (*ButtonOrderResourceRule) Confidence

func (r *ButtonOrderResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android accessibility resource rule. Detection flags missing contentDescription, importantForAccessibility, and focusable attributes via structural checks. Classified per roadmap/17.

func (*ButtonOrderResourceRule) Meta

type ButtonStyleResourceRule

type ButtonStyleResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

ButtonStyleResourceRule detects dialog-style buttons without borderless style. Buttons in dialog or alert layouts should use a Borderless button style.

func (*ButtonStyleResourceRule) Confidence

func (r *ButtonStyleResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android accessibility resource rule. Detection flags missing contentDescription, importantForAccessibility, and focusable attributes via structural checks. Classified per roadmap/17.

func (*ButtonStyleResourceRule) Meta

type ByteOrderMarkRule

type ByteOrderMarkRule struct{ AndroidRule }

ByteOrderMarkRule detects BOM (byte order mark) in files.

func (*ByteOrderMarkRule) Confidence

func (r *ByteOrderMarkRule) Confidence() float64

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 — the BOM check is a literal three-byte compare at the start of the file content. No heuristic path.

func (*ByteOrderMarkRule) Meta

type CanBeNonNullableRule

type CanBeNonNullableRule struct {
	FlatDispatchBase
	BaseRule
}

CanBeNonNullableRule detects nullable types that are never assigned null. Handles two cases: 1. Properties initialized with non-null values that are never reassigned to null. 2. Function parameters declared nullable but only used with !! (non-null assertion). Skips override/open/abstract functions, delegated properties, and properties with custom setters. Tracks null assignments through if/when branches and lambda bodies.

Known limitations:

  • Cannot track nullable assignments through function calls (fun setNull(x) { field = null })
  • Cannot detect properties assigned null via reflection or Java interop

func (*CanBeNonNullableRule) Confidence

func (r *CanBeNonNullableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — detecting which nullable properties are never assigned null requires flow analysis; the fallback is a conservative heuristic. Classified per roadmap/17.

func (*CanBeNonNullableRule) Meta

func (*CanBeNonNullableRule) SetResolver

func (r *CanBeNonNullableRule) SetResolver(_ typeinfer.TypeResolver)

type CascadingCallWrappingRule

type CascadingCallWrappingRule struct {
	LineBase
	BaseRule
	IncludeElvis bool
}

CascadingCallWrappingRule checks that chained calls are wrapped consistently.

func (*CascadingCallWrappingRule) Confidence

func (r *CascadingCallWrappingRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/formatting rule. Detection is pattern or regex based on line text; deterministic byte checks have been promoted to tier-1 separately. Classified per roadmap/17.

func (*CascadingCallWrappingRule) Meta

type CastNullableToNonNullableTypeRule

type CastNullableToNonNullableTypeRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- CastNullableToNonNullableTypeRule detects `as Type` on nullable expression. ---------------------------------------------------------------------------

func (*CastNullableToNonNullableTypeRule) Confidence

Confidence reports a tier-2 (medium) base confidence. The rule is resolver-backed so it only reports when source nullability is known.

func (*CastNullableToNonNullableTypeRule) IsFixable

func (r *CastNullableToNonNullableTypeRule) IsFixable() bool

func (*CastNullableToNonNullableTypeRule) Meta

type CastToNullableTypeRule

type CastToNullableTypeRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- CastToNullableTypeRule detects `as Type?`. ---------------------------------------------------------------------------

func (*CastToNullableTypeRule) Confidence

func (r *CastToNullableTypeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs null safety rule. Detection leans on structural patterns around nullable expressions and has a heuristic fallback when the resolver is absent. Classified per roadmap/17.

func (*CastToNullableTypeRule) IsFixable

func (r *CastToNullableTypeRule) IsFixable() bool

func (*CastToNullableTypeRule) Meta

type ChannelReceiveWithoutCloseRule

type ChannelReceiveWithoutCloseRule struct {
	FlatDispatchBase
	BaseRule
}

ChannelReceiveWithoutCloseRule detects Channel properties that are never closed.

func (*ChannelReceiveWithoutCloseRule) Confidence

func (r *ChannelReceiveWithoutCloseRule) Confidence() float64

func (*ChannelReceiveWithoutCloseRule) Meta

type CharArrayToStringCallRule

type CharArrayToStringCallRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- CharArrayToStringCallRule detects charArray.toString() calls. ---------------------------------------------------------------------------

func (*CharArrayToStringCallRule) IsFixable

func (r *CharArrayToStringCallRule) IsFixable() bool

func (*CharArrayToStringCallRule) Meta

type CheckResultRule

type CheckResultRule struct {
	FlatDispatchBase
	AndroidRule
}

CheckResultRule detects ignoring return values annotated with @CheckResult.

func (*CheckResultRule) Confidence

func (r *CheckResultRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*CheckResultRule) Meta

type ClassNamingRule

type ClassNamingRule struct {
	FlatDispatchBase
	BaseRule
	Pattern *regexp.Regexp
}

ClassNamingRule checks class names match a pattern.

func (*ClassNamingRule) Confidence

func (r *ClassNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*ClassNamingRule) Meta

type ClassOrderingRule

type ClassOrderingRule struct {
	FlatDispatchBase
	BaseRule
}

ClassOrderingRule checks that class members are in the conventional order.

func (*ClassOrderingRule) Confidence

func (r *ClassOrderingRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/classes rule. Detection relies on modifier and declaration structure plus (optional) resolver-backed inheritance checks; the fallback path is heuristic. Classified per roadmap/17.

func (*ClassOrderingRule) IsFixable

func (r *ClassOrderingRule) IsFixable() bool

func (*ClassOrderingRule) Meta

type CleartextTrafficRule

type CleartextTrafficRule struct {
	ManifestBase
	AndroidRule
}

CleartextTrafficRule flags android:usesCleartextTraffic="true" as a security concern.

func (*CleartextTrafficRule) Meta

type ClickableViewAccessibilityResourceRule

type ClickableViewAccessibilityResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

ClickableViewAccessibilityResourceRule detects views that have android:clickable="true" but are missing a contentDescription. Clickable views need a content description so screen readers can announce them.

func (*ClickableViewAccessibilityResourceRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Android accessibility resource rule. Detection flags missing contentDescription, importantForAccessibility, and focusable attributes via structural checks. Classified per roadmap/17.

func (*ClickableViewAccessibilityResourceRule) Meta

type ClipboardOnSensitiveInputTypeRule

type ClipboardOnSensitiveInputTypeRule struct {
	FlatDispatchBase
	BaseRule
}

ClipboardOnSensitiveInputTypeRule flags setPrimaryClip calls where the source variable name suggests a password or credential field.

func (*ClipboardOnSensitiveInputTypeRule) Confidence

func (*ClipboardOnSensitiveInputTypeRule) Meta

type CognitiveComplexMethodRule

type CognitiveComplexMethodRule struct {
	FlatDispatchBase
	BaseRule
	AllowedComplexity int
}

CognitiveComplexMethodRule measures cognitive complexity, weighting nesting depth.

func (*CognitiveComplexMethodRule) Confidence

func (r *CognitiveComplexMethodRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*CognitiveComplexMethodRule) Meta

type CollapsibleIfStatementsRule

type CollapsibleIfStatementsRule struct {
	FlatDispatchBase
	BaseRule
}

CollapsibleIfStatementsRule detects nested if without else.

func (*CollapsibleIfStatementsRule) Confidence

func (r *CollapsibleIfStatementsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection is pattern-based and the preferred form is a style preference. Classified per roadmap/17.

func (*CollapsibleIfStatementsRule) IsFixable

func (r *CollapsibleIfStatementsRule) IsFixable() bool

Style2 fixable rules (batch 3)

func (*CollapsibleIfStatementsRule) Meta

type CollectInOnCreateWithoutLifecycleRule

type CollectInOnCreateWithoutLifecycleRule struct {
	FlatDispatchBase
	BaseRule
}

CollectInOnCreateWithoutLifecycleRule detects Flow.collect calls in lifecycle callbacks that are not wrapped by repeatOnLifecycle.

func (*CollectInOnCreateWithoutLifecycleRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Coroutines rule. Detection matches kotlinx.coroutines call shapes via name lists and structural patterns; project wrappers can escape or collide. Classified per roadmap/17.

func (*CollectInOnCreateWithoutLifecycleRule) Meta

type CollectionsSynchronizedListIterationRule

type CollectionsSynchronizedListIterationRule struct {
	FlatDispatchBase
	BaseRule
}

CollectionsSynchronizedListIterationRule detects iteration over synchronized wrappers without external sync.

func (*CollectionsSynchronizedListIterationRule) Confidence

func (*CollectionsSynchronizedListIterationRule) Meta

type CommentedOutCodeBlockRule

type CommentedOutCodeBlockRule struct {
	LineBase
	BaseRule
	MinLines int
}

CommentedOutCodeBlockRule flags runs of line comments that look like disabled Kotlin statements rather than prose.

func (*CommentedOutCodeBlockRule) Confidence

func (r *CommentedOutCodeBlockRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Release-engineering rule. Detection scans module metadata and Gradle files for configuration drift and plugin hygiene; matches are project-structure-sensitive. Classified per roadmap/17.

func (*CommentedOutCodeBlockRule) Meta

type CommentedOutImportRule

type CommentedOutImportRule struct {
	FlatDispatchBase
	BaseRule
}

CommentedOutImportRule flags `// import ...` lines — a commented-out import is either dead or a half-done refactor.

func (*CommentedOutImportRule) Confidence

func (r *CommentedOutImportRule) Confidence() float64

func (*CommentedOutImportRule) Meta

type CommitPrefEditsRule

type CommitPrefEditsRule struct {
	FlatDispatchBase
	AndroidRule
}

CommitPrefEditsRule detects SharedPreferences.edit() without .commit() or .apply().

func (*CommitPrefEditsRule) Confidence

func (r *CommitPrefEditsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*CommitPrefEditsRule) Meta

type CommitTransactionRule

type CommitTransactionRule struct {
	FlatDispatchBase
	AndroidRule
}

CommitTransactionRule detects FragmentTransaction without .commit().

func (*CommitTransactionRule) Confidence

func (r *CommitTransactionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*CommitTransactionRule) Meta

type CompileSdkMismatchAcrossModulesRule

type CompileSdkMismatchAcrossModulesRule struct {
	BaseRule
}

CompileSdkMismatchAcrossModulesRule flags Android modules whose compileSdk is lower than the maximum compileSdk declared elsewhere in the same Gradle project.

func (*CompileSdkMismatchAcrossModulesRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Supply-chain rule. Detection scans module metadata and dependency catalogs for drift and security issues; matches are project-structure-sensitive. Classified per roadmap/17.

func (*CompileSdkMismatchAcrossModulesRule) Meta

func (*CompileSdkMismatchAcrossModulesRule) ModuleAwareNeeds

type ComplexConditionRule

type ComplexConditionRule struct {
	FlatDispatchBase
	BaseRule
	AllowedConditions int
}

ComplexConditionRule detects conditions with too many logical operators.

func (*ComplexConditionRule) Confidence

func (r *ComplexConditionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*ComplexConditionRule) Meta

type ComplexInterfaceRule

type ComplexInterfaceRule struct {
	FlatDispatchBase
	BaseRule
	AllowedDefinitions         int
	IncludePrivateDeclarations bool
	IncludeStaticDeclarations  bool
}

ComplexInterfaceRule detects interfaces with too many members.

func (*ComplexInterfaceRule) Confidence

func (r *ComplexInterfaceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*ComplexInterfaceRule) Meta

type ComponentMissingModuleRule

type ComponentMissingModuleRule struct {
	FlatDispatchBase
	BaseRule
}

ComponentMissingModuleRule detects `@Component(modules = [...])` declarations whose listed modules do not transitively cover every binding reachable through the component's exposed methods.

func (*ComponentMissingModuleRule) Confidence

func (r *ComponentMissingModuleRule) Confidence() float64

Confidence reports a tier-3 (lower) base confidence. Detection follows @Provides/@Binds return types and @Inject constructor parameters in source; generated code, multibindings, and assisted factories are not modeled.

func (*ComponentMissingModuleRule) Meta

type ComposeClickableWithoutMinTouchTargetRule

type ComposeClickableWithoutMinTouchTargetRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeClickableWithoutMinTouchTargetRule flags clickable Modifier chains with explicit width/height/size dp literals below the 48.dp minimum touch target. Implicit-size cases are too context-dependent to flag reliably without layout awareness.

func (*ComposeClickableWithoutMinTouchTargetRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Accessibility rule. Detection matches on Compose/View API call shapes and argument labels by name rather than by resolved type. Classified per roadmap/17.

func (*ComposeClickableWithoutMinTouchTargetRule) Meta

type ComposeColumnRowInScrollableRule

type ComposeColumnRowInScrollableRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeColumnRowInScrollableRule flags nested same-axis Compose scroll containers such as Column(verticalScroll) containing LazyColumn.

func (*ComposeColumnRowInScrollableRule) Confidence

func (r *ComposeColumnRowInScrollableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeColumnRowInScrollableRule) Meta

type ComposeDecorativeImageContentDescriptionRule

type ComposeDecorativeImageContentDescriptionRule struct {
	FlatDispatchBase
	BaseRule
}

func (*ComposeDecorativeImageContentDescriptionRule) Confidence

func (*ComposeDecorativeImageContentDescriptionRule) Meta

type ComposeDerivedStateMisuseRule

type ComposeDerivedStateMisuseRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeDerivedStateMisuseRule detects derivedStateOf around direct boolean comparisons of Compose state reads. Those reads already trigger recomposition, so wrapping them in derivedStateOf usually adds overhead without reducing updates.

func (*ComposeDerivedStateMisuseRule) Confidence

func (r *ComposeDerivedStateMisuseRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeDerivedStateMisuseRule) Meta

type ComposeDisposableEffectMissingDisposeRule

type ComposeDisposableEffectMissingDisposeRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeDisposableEffectMissingDisposeRule flags `DisposableEffect(key) { ... }` whose trailing lambda does not end with an `onDispose { }` call. Without `onDispose`, the registered resource leaks when the composable leaves the composition.

func (*ComposeDisposableEffectMissingDisposeRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeDisposableEffectMissingDisposeRule) Meta

type ComposeIconButtonMissingContentDescriptionRule

type ComposeIconButtonMissingContentDescriptionRule struct {
	FlatDispatchBase
	BaseRule
}

func (*ComposeIconButtonMissingContentDescriptionRule) Confidence

func (*ComposeIconButtonMissingContentDescriptionRule) Meta

type ComposeLambdaCapturesUnstableStateRule

type ComposeLambdaCapturesUnstableStateRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeLambdaCapturesUnstableStateRule flags inline onClick lambdas in lazy item builders when they capture the current item directly instead of hoisting the callback through remember(item) { ... }.

func (*ComposeLambdaCapturesUnstableStateRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeLambdaCapturesUnstableStateRule) Meta

type ComposeLaunchedEffectWithoutKeysRule

type ComposeLaunchedEffectWithoutKeysRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeLaunchedEffectWithoutKeysRule flags `LaunchedEffect(Unit) { f(param) }` where the effect body references an enclosing parameter but the keys are constant (Unit / true / false / null). The effect won't re-run when the parameter changes.

func (*ComposeLaunchedEffectWithoutKeysRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeLaunchedEffectWithoutKeysRule) Meta

type ComposeModifierBackgroundAfterClipRule

type ComposeModifierBackgroundAfterClipRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeModifierBackgroundAfterClipRule flags `Modifier.background(...).clip(...)` where the background is drawn in the un-clipped rectangular region instead of the clipped shape the author almost certainly intended.

func (*ComposeModifierBackgroundAfterClipRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeModifierBackgroundAfterClipRule) Meta

type ComposeModifierClickableBeforePaddingRule

type ComposeModifierClickableBeforePaddingRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeModifierClickableBeforePaddingRule flags `Modifier.clickable { }.padding(...)` — the click area excludes the padding region, which is almost never what the author wants.

func (*ComposeModifierClickableBeforePaddingRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeModifierClickableBeforePaddingRule) Meta

type ComposeModifierFillAfterSizeRule

type ComposeModifierFillAfterSizeRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeModifierFillAfterSizeRule flags chained Compose Modifier calls where a `fillMaxWidth` / `fillMaxHeight` / `fillMaxSize` call immediately follows `size(...)`. The fillMax call overrides the explicit size on one or both axes, which is almost always an author mistake.

func (*ComposeModifierFillAfterSizeRule) Confidence

func (r *ComposeModifierFillAfterSizeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeModifierFillAfterSizeRule) Meta

type ComposeModifierPassedThenChainedRule

type ComposeModifierPassedThenChainedRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeModifierPassedThenChainedRule flags a @Composable function that declares a `modifier: Modifier` parameter but never actually uses it — the body starts fresh `Modifier.X()` chains, dropping anything the caller passed in.

func (*ComposeModifierPassedThenChainedRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeModifierPassedThenChainedRule) Meta

type ComposeMutableDefaultArgumentRule

type ComposeMutableDefaultArgumentRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeMutableDefaultArgumentRule flags `@Composable fun Foo(items: MutableList<X> = mutableListOf())` — the mutable default evaluates on each recomposition, creating a fresh collection that silently breaks identity checks and can leak state across composes.

func (*ComposeMutableDefaultArgumentRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeMutableDefaultArgumentRule) Meta

type ComposeMutableStateInCompositionRule

type ComposeMutableStateInCompositionRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeMutableStateInCompositionRule flags `val count = mutableStateOf(0)` as a local property inside a @Composable function. Without a surrounding `remember { }`, the state is reconstructed on every recomposition and silently discards any updates.

func (*ComposeMutableStateInCompositionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeMutableStateInCompositionRule) Meta

type ComposePainterResourceInLoopRule

type ComposePainterResourceInLoopRule struct {
	FlatDispatchBase
	BaseRule
}

ComposePainterResourceInLoopRule detects painterResource() inside forEach/items lambda bodies.

func (*ComposePainterResourceInLoopRule) Confidence

func (r *ComposePainterResourceInLoopRule) Confidence() float64

func (*ComposePainterResourceInLoopRule) Meta

type ComposePreviewAnnotationMissingRule

type ComposePreviewAnnotationMissingRule struct {
	FlatDispatchBase
	BaseRule
}

ComposePreviewAnnotationMissingRule flags `@Composable fun FooPreview()` whose name ends in "Preview" but which is missing the `@Preview` annotation. Such functions almost always intend to render a preview in Android Studio; without `@Preview` they're dead code at preview time.

func (*ComposePreviewAnnotationMissingRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposePreviewAnnotationMissingRule) Meta

type ComposePreviewWithBackingStateRule

type ComposePreviewWithBackingStateRule struct {
	FlatDispatchBase
	BaseRule
}

ComposePreviewWithBackingStateRule flags `@Preview @Composable fun FooPreview()` whose body calls a runtime state holder like `hiltViewModel()`, `viewModel()`, or `collectAsState*()` — those won't work in the Android Studio preview renderer and will either crash or render a placeholder. Previews should use fake/injected data.

func (*ComposePreviewWithBackingStateRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposePreviewWithBackingStateRule) Meta

type ComposeRawTextLiteralRule

type ComposeRawTextLiteralRule struct {
	FlatDispatchBase
	BaseRule
	CustomPreviewWildcard bool
	CustomPreviewPrefixes []string
}

func (*ComposeRawTextLiteralRule) Confidence

func (r *ComposeRawTextLiteralRule) Confidence() float64

func (*ComposeRawTextLiteralRule) Meta

type ComposeRememberInListRule

type ComposeRememberInListRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeRememberInListRule detects remember{} inside items{} lambda without a key argument — causes recomputation on list reordering.

func (*ComposeRememberInListRule) Confidence

func (r *ComposeRememberInListRule) Confidence() float64

func (*ComposeRememberInListRule) Meta

type ComposeRememberSaveableNonParcelableRule

type ComposeRememberSaveableNonParcelableRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeRememberSaveableNonParcelableRule flags `rememberSaveable { SomeType() }` where SomeType() is a constructor call to a plain class with no `saver` / `stateSaver` argument passed. Without a saver, rememberSaveable falls back to AutoSaver which only handles primitives, Parcelables, and a few stdlib types.

Since this rule is syntactic it can't verify Parcelable status — it warns on any constructor-looking call in the trailing lambda whose name doesn't match a well-known stdlib type. Users can suppress the finding locally when they know the type is Parcelable/Serializable.

func (*ComposeRememberSaveableNonParcelableRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeRememberSaveableNonParcelableRule) Meta

type ComposeRememberWithoutKeyRule

type ComposeRememberWithoutKeyRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeRememberWithoutKeyRule flags `remember { f(param) }` where the lambda body references an enclosing function parameter but the remember call has no key arguments. The cached value won't update when the parameter changes across recomposition.

func (*ComposeRememberWithoutKeyRule) Confidence

func (r *ComposeRememberWithoutKeyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeRememberWithoutKeyRule) Meta

type ComposeSemanticsMissingRoleRule

type ComposeSemanticsMissingRoleRule struct {
	FlatDispatchBase
	BaseRule
	CustomPreviewWildcard bool
	CustomPreviewPrefixes []string
}

func (*ComposeSemanticsMissingRoleRule) Confidence

func (r *ComposeSemanticsMissingRoleRule) Confidence() float64

func (*ComposeSemanticsMissingRoleRule) Meta

type ComposeSideEffectInCompositionRule

type ComposeSideEffectInCompositionRule struct {
	FlatDispatchBase
	BaseRule
	CustomPreviewWildcard bool
	CustomPreviewPrefixes []string
}

ComposeSideEffectInCompositionRule flags direct assignments inside a @Composable function body that aren't wrapped in a recognized effect block (LaunchedEffect / SideEffect / DisposableEffect). Assignments during composition run on every recomposition and cause unpredictable behavior — mutations belong in an effect scope.

func (*ComposeSideEffectInCompositionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeSideEffectInCompositionRule) Meta

type ComposeStatefulDefaultParameterRule

type ComposeStatefulDefaultParameterRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeStatefulDefaultParameterRule flags `@Composable fun Foo(state: MyState = MyState())` — the `MyState()` default allocates a fresh instance on every recomposition, breaking state hoisting and silently dropping accumulated state. The safe pattern is `= rememberMyState()` or `= remember { MyState() }`, both of which return the same instance across recompositions.

func (*ComposeStatefulDefaultParameterRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeStatefulDefaultParameterRule) Meta

type ComposeStringResourceInsideLambdaRule

type ComposeStringResourceInsideLambdaRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeStringResourceInsideLambdaRule flags `stringResource(...)` calls nested inside a callback-style named-argument lambda (e.g. `onClick = { ... stringResource(R.string.X) ... }`). `stringResource` is composition- only and will crash when invoked from a non-composable callback lambda; the safe pattern is to hoist the resource lookup above the lambda.

func (*ComposeStringResourceInsideLambdaRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeStringResourceInsideLambdaRule) Meta

type ComposeTextFieldMissingLabelRule

type ComposeTextFieldMissingLabelRule struct {
	FlatDispatchBase
	BaseRule
}

func (*ComposeTextFieldMissingLabelRule) Confidence

func (r *ComposeTextFieldMissingLabelRule) Confidence() float64

func (*ComposeTextFieldMissingLabelRule) Meta

type ComposeUnstableParameterRule

type ComposeUnstableParameterRule struct {
	FlatDispatchBase
	BaseRule
}

ComposeUnstableParameterRule flags `@Composable fun X(users: List<User>)` whose parameters use the mutable Kotlin collection types (`List`, `Map`, `Set`, `MutableList`, etc.) directly. Compose considers these unstable for recomposition-skipping unless the author wraps them in a stable type (`@Immutable data class`, `ImmutableList` / `PersistentList` from kotlinx.collections.immutable).

func (*ComposeUnstableParameterRule) Confidence

func (r *ComposeUnstableParameterRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Compose rule. Detection relies on call-name token matching (e.g. 'verticalScroll', 'LazyColumn', 'rememberSaveable') rather than type resolution, so any project symbol with a matching name or token can produce a false match. Classified per roadmap/17.

func (*ComposeUnstableParameterRule) Meta

type ConcurrentModificationIterationRule

type ConcurrentModificationIterationRule struct {
	FlatDispatchBase
	BaseRule
}

ConcurrentModificationIterationRule detects collection mutation inside for loops.

func (*ConcurrentModificationIterationRule) Confidence

func (*ConcurrentModificationIterationRule) Meta

type ConfigAdapter

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

ConfigAdapter wraps *config.Config so it satisfies api.ConfigSource.

The rule metadata runtime reads YAML-derived values through a small interface so rule metadata stays free of any YAML-specific plumbing. This adapter bridges the gap between the existing internal/config package and the Meta descriptors.

The adapter is a thin pass-through: every ConfigSource method delegates directly to the corresponding *config.Config method. The one piece of new surface area is HasKey, which is backed by config.Config.Has (added alongside this adapter for exactly that purpose).

func NewConfigAdapter

func NewConfigAdapter(cfg *config.Config) *ConfigAdapter

NewConfigAdapter wraps cfg in a api.ConfigSource-compatible adapter. A nil cfg is allowed: every method short-circuits to "no override", which is the same behavior as *config.Config's own nil-safe accessors.

func (*ConfigAdapter) GetBool

func (a *ConfigAdapter) GetBool(ruleSet, rule, key string, def bool) bool

GetBool implements api.ConfigSource.

func (*ConfigAdapter) GetInt

func (a *ConfigAdapter) GetInt(ruleSet, rule, key string, def int) int

GetInt implements api.ConfigSource.

func (*ConfigAdapter) GetString

func (a *ConfigAdapter) GetString(ruleSet, rule, key, def string) string

GetString implements api.ConfigSource.

func (*ConfigAdapter) GetStringList

func (a *ConfigAdapter) GetStringList(ruleSet, rule, key string) []string

GetStringList implements api.ConfigSource.

func (*ConfigAdapter) HasKey

func (a *ConfigAdapter) HasKey(ruleSet, rule, key string) bool

HasKey implements api.ConfigSource.

func (*ConfigAdapter) IsRuleActive

func (a *ConfigAdapter) IsRuleActive(ruleSet, rule string) *bool

IsRuleActive implements api.ConfigSource.

func (*ConfigAdapter) IsRuleSetActive

func (a *ConfigAdapter) IsRuleSetActive(ruleSet string) *bool

IsRuleSetActive implements api.ConfigSource.

func (*ConfigAdapter) Unwrap

func (a *ConfigAdapter) Unwrap() *config.Config

Unwrap returns the wrapped *config.Config. Primarily useful for tests that want to inspect the underlying data after running the adapter.

type ConfigurationsAllSideEffectRule

type ConfigurationsAllSideEffectRule struct {
	GradleBase
	BaseRule

	AllowInConventionPlugins bool
}

func (*ConfigurationsAllSideEffectRule) Confidence

func (r *ConfigurationsAllSideEffectRule) Confidence() float64

func (*ConfigurationsAllSideEffectRule) Meta

type ConstructorParameterNamingRule

type ConstructorParameterNamingRule struct {
	FlatDispatchBase
	BaseRule
	Pattern                 *regexp.Regexp
	PrivateParameterPattern *regexp.Regexp
	ExcludeClassPattern     *regexp.Regexp
}

ConstructorParameterNamingRule checks constructor val/var parameter names.

func (*ConstructorParameterNamingRule) Confidence

func (r *ConstructorParameterNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*ConstructorParameterNamingRule) Meta

type ContactsAccessWithoutPermissionUIRule

type ContactsAccessWithoutPermissionUIRule struct {
	FlatDispatchBase
	BaseRule
}

ContactsAccessWithoutPermissionUIRule flags contacts queries that are not gated behind a RequestPermission activity-result callback.

func (*ContactsAccessWithoutPermissionUIRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Privacy/permissions rule. Detection pattern-matches sensitive API call shapes and annotation names without cross-checking project permission contracts. Classified per roadmap/17.

func (*ContactsAccessWithoutPermissionUIRule) Meta

type ContentDescriptionRule

type ContentDescriptionRule struct {
	FlatDispatchBase
	AndroidRule
}

ContentDescriptionRule checks for ImageView/ImageButton without contentDescription. Kotlin equivalent: detects missing contentDescription in Compose Image() calls.

func (*ContentDescriptionRule) Confidence

func (r *ContentDescriptionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ContentDescriptionRule) Meta

type ContentProviderQueryWithSelectionInterpolationRule

type ContentProviderQueryWithSelectionInterpolationRule struct {
	FlatDispatchBase
	BaseRule
}

ContentProviderQueryWithSelectionInterpolationRule detects interpolated selection strings passed to ContentResolver.query(...).

func (*ContentProviderQueryWithSelectionInterpolationRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Security rule. Detection pattern-matches known-insecure API shapes and argument literals without confirming the receiver type. Classified per roadmap/17.

func (*ContentProviderQueryWithSelectionInterpolationRule) Meta

type ConventionPluginAppliedToWrongTargetRule

type ConventionPluginAppliedToWrongTargetRule struct {
	BaseRule

	PluginTargetMap []string
}

func (*ConventionPluginAppliedToWrongTargetRule) Confidence

func (*ConventionPluginAppliedToWrongTargetRule) Meta

func (*ConventionPluginAppliedToWrongTargetRule) ModuleAwareNeeds

type ConventionPluginDeadCodeRule

type ConventionPluginDeadCodeRule struct {
	BaseRule
}

ConventionPluginDeadCodeRule flags precompiled convention plugins declared under build-logic/ or buildSrc/ that are not applied by any module.

func (*ConventionPluginDeadCodeRule) Confidence

func (r *ConventionPluginDeadCodeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Release-engineering rule. Detection scans module metadata and Gradle files for configuration drift and plugin hygiene; matches are project-structure-sensitive. Classified per roadmap/17.

func (*ConventionPluginDeadCodeRule) Meta

func (*ConventionPluginDeadCodeRule) ModuleAwareNeeds

func (r *ConventionPluginDeadCodeRule) ModuleAwareNeeds() ModuleAwareNeeds

type ConvertToWebpRule

type ConvertToWebpRule struct {
	IconResourceBase
	AndroidRule
}

ConvertToWebpRule detects large PNGs that could be smaller as WebP.

func (*ConvertToWebpRule) Confidence

func (r *ConvertToWebpRule) Confidence() float64

func (*ConvertToWebpRule) Meta

type CopyrightYearOutdatedRule

type CopyrightYearOutdatedRule struct {
	LineBase
	BaseRule
	RecentYearCutoff int
}

CopyrightYearOutdatedRule flags stale copyright years in the leading file header. This iteration intentionally limits itself to header scanning and a fixed cutoff; git-backed recency validation can layer on top later.

func (*CopyrightYearOutdatedRule) Confidence

func (r *CopyrightYearOutdatedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Licensing rule. Detection scans file headers and manifests for license markers via regex; custom or non-English headers can produce false negatives. Classified per roadmap/17.

type CoroutineLaunchedInTestWithoutRunTestRule

type CoroutineLaunchedInTestWithoutRunTestRule struct {
	FlatDispatchBase
	BaseRule
}

CoroutineLaunchedInTestWithoutRunTestRule detects launch/async in @Test without runTest.

func (*CoroutineLaunchedInTestWithoutRunTestRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Coroutines rule. Detection matches kotlinx.coroutines call shapes via name lists and structural patterns; project wrappers can escape or collide. Classified per roadmap/17.

func (*CoroutineLaunchedInTestWithoutRunTestRule) Meta

type CoroutineScopeCreatedButNeverCancelledRule

type CoroutineScopeCreatedButNeverCancelledRule struct {
	FlatDispatchBase
	BaseRule
}

CoroutineScopeCreatedButNeverCancelledRule detects CoroutineScope properties without cancel().

func (*CoroutineScopeCreatedButNeverCancelledRule) Confidence

func (*CoroutineScopeCreatedButNeverCancelledRule) Meta

type CouldBeSequenceRule

type CouldBeSequenceRule struct {
	FlatDispatchBase
	BaseRule
	AllowedOperations int
}

CouldBeSequenceRule detects collection operation chains that could be sequences.

func (*CouldBeSequenceRule) Confidence

func (r *CouldBeSequenceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — detects long collection chains that should use asSequence(); chain-length heuristic is conservative but the threshold is a style call. Classified per roadmap/17.

func (*CouldBeSequenceRule) IsFixable

func (r *CouldBeSequenceRule) IsFixable() bool

func (*CouldBeSequenceRule) Meta

type CrashlyticsCustomKeyWithPiiRule

type CrashlyticsCustomKeyWithPiiRule struct {
	FlatDispatchBase
	BaseRule
}

CrashlyticsCustomKeyWithPiiRule flags setCustomKey calls where the key name matches PII patterns.

func (*CrashlyticsCustomKeyWithPiiRule) Confidence

func (r *CrashlyticsCustomKeyWithPiiRule) Confidence() float64

func (*CrashlyticsCustomKeyWithPiiRule) Meta

type CursorLoopWithColumnIndexInLoopRule

type CursorLoopWithColumnIndexInLoopRule struct {
	FlatDispatchBase
	BaseRule
}

CursorLoopWithColumnIndexInLoopRule detects getColumnIndex() calls inside cursor.moveToNext() while loops.

func (*CursorLoopWithColumnIndexInLoopRule) Confidence

func (*CursorLoopWithColumnIndexInLoopRule) Meta

type CustomViewStyleableRule

type CustomViewStyleableRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*CustomViewStyleableRule) Confidence

func (r *CustomViewStyleableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*CustomViewStyleableRule) Meta

type CutPasteIDResourceRule

type CutPasteIDResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

CutPasteIDResourceRule detects likely copy-paste ID mistakes where a view's android:id name contains a prefix/hint that suggests a different view type. For example, `@+id/textview_name` on a Button suggests copy-paste from a TextView.

func (*CutPasteIDResourceRule) Confidence

func (r *CutPasteIDResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*CutPasteIDResourceRule) Meta

type CyclomaticComplexMethodRule

type CyclomaticComplexMethodRule struct {
	FlatDispatchBase
	BaseRule
	AllowedComplexity          int
	IgnoreSimpleWhenEntries    bool
	IgnoreSingleWhenExpression bool
	IgnoreLocalFunctions       bool
	IgnoreNestingFunctions     bool
	NestingFunctions           []string
}

CyclomaticComplexMethodRule counts decision points per function.

func (*CyclomaticComplexMethodRule) Confidence

func (r *CyclomaticComplexMethodRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*CyclomaticComplexMethodRule) Description

func (*CyclomaticComplexMethodRule) Description() string

Description implements DescriptionProvider.

func (*CyclomaticComplexMethodRule) Meta

type DaoNotInterfaceRule

type DaoNotInterfaceRule struct {
	FlatDispatchBase
	BaseRule
}

DaoNotInterfaceRule detects Room DAOs declared as abstract classes.

func (*DaoNotInterfaceRule) Confidence

func (r *DaoNotInterfaceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names and function calls without confirming the declared type is a Room DAO or entity. Classified per roadmap/17.

func (*DaoNotInterfaceRule) Meta

type DaoWithoutAnnotationsRule

type DaoWithoutAnnotationsRule struct {
	FlatDispatchBase
	BaseRule
}

DaoWithoutAnnotationsRule detects Room DAO member functions that are missing any Room operation annotation.

func (*DaoWithoutAnnotationsRule) Confidence

func (r *DaoWithoutAnnotationsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names and function calls without confirming the declared type is a Room DAO or entity. Classified per roadmap/17.

func (*DaoWithoutAnnotationsRule) Meta

type DataClassContainsFunctionsRule

type DataClassContainsFunctionsRule struct {
	FlatDispatchBase
	BaseRule
	ConversionFunctionPrefix []string
}

DataClassContainsFunctionsRule detects data classes with function members.

func (*DataClassContainsFunctionsRule) Confidence

func (r *DataClassContainsFunctionsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/classes rule. Detection relies on modifier and declaration structure plus (optional) resolver-backed inheritance checks; the fallback path is heuristic. Classified per roadmap/17.

func (*DataClassContainsFunctionsRule) Meta

type DataClassShouldBeImmutableRule

type DataClassShouldBeImmutableRule struct {
	FlatDispatchBase
	BaseRule
}

DataClassShouldBeImmutableRule detects var properties in data classes. With type inference: also flags val properties whose types are mutable collections (MutableList, MutableMap, MutableSet) since they undermine data class immutability.

func (*DataClassShouldBeImmutableRule) Confidence

func (r *DataClassShouldBeImmutableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — detecting mutable properties in data classes needs type-aware var detection; fallback uses keyword matching. Classified per roadmap/17.

func (*DataClassShouldBeImmutableRule) IsFixable

func (r *DataClassShouldBeImmutableRule) IsFixable() bool

func (*DataClassShouldBeImmutableRule) Meta

type DatabaseInstanceRecreatedRule

type DatabaseInstanceRecreatedRule struct {
	FlatDispatchBase
	BaseRule
}

DatabaseInstanceRecreatedRule detects Room.databaseBuilder calls in regular functions where the database would be rebuilt on each invocation.

func (*DatabaseInstanceRecreatedRule) Confidence

func (r *DatabaseInstanceRecreatedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names and function calls without confirming the declared type is a Room DAO or entity. Classified per roadmap/17.

func (*DatabaseInstanceRecreatedRule) Meta

type DatabaseQueryOnMainThreadRule

type DatabaseQueryOnMainThreadRule struct {
	FlatDispatchBase
	BaseRule
}

DatabaseQueryOnMainThreadRule detects SQLiteDatabase.rawQuery()/query() calls in non-suspend functions without withContext.

func (*DatabaseQueryOnMainThreadRule) Confidence

func (r *DatabaseQueryOnMainThreadRule) Confidence() float64

func (*DatabaseQueryOnMainThreadRule) Meta

type DeadBindingsRule

type DeadBindingsRule struct {
	FlatDispatchBase
	BaseRule
}

DeadBindingsRule detects @Provides/@Binds functions whose return type is not requested by any @Inject site or component exposure anywhere in the project.

func (*DeadBindingsRule) Confidence

func (r *DeadBindingsRule) Confidence() float64

Confidence reports a tier-3 (lower) base confidence. Reachability is approximated from source-visible @Inject sites and component method exposures; project-specific DI machinery (assisted factories, multibindings, generated code) is not modeled.

func (*DeadBindingsRule) Meta

type DeadCodeRule

type DeadCodeRule struct {
	BaseRule
	// IgnoreCommentReferences: if true (default), a symbol referenced only in comments
	// is still considered dead code. If false, comment references count as usage.
	IgnoreCommentReferences bool
}

DeadCodeRule detects public/internal symbols that are never referenced from any other file. This is a cross-file rule that requires the CodeIndex to be populated.

func (*DeadCodeRule) Confidence

func (r *DeadCodeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule relies on the cross-file code index to detect unreferenced symbols and then filters framework entry points, overrides, tests, lifecycle methods, and DI declarations that are consumed by generated code.

func (*DeadCodeRule) IsFixable

func (r *DeadCodeRule) IsFixable() bool

DeadCode is advertised as not-fixable because the symbol-deletion span (line range, leading KDoc, surrounding blank lines) is non-trivial to compute from the cross-file index alone and the current Check() path never populates a Fix. Removing a dead symbol remains a manual operation. Left in fixes.go history for when the per-symbol deletion pipeline lands.

func (*DeadCodeRule) Meta

func (r *DeadCodeRule) Meta() api.RuleDescriptor

type DebugToastInProductionRule

type DebugToastInProductionRule struct {
	FlatDispatchBase
	BaseRule
}

DebugToastInProductionRule flags Toast.makeText calls whose message literal starts with "debug", "test", or "wip" (case-insensitive).

func (*DebugToastInProductionRule) Confidence

func (r *DebugToastInProductionRule) Confidence() float64

func (*DebugToastInProductionRule) Meta

type DebuggableManifestRule

type DebuggableManifestRule struct {
	ManifestBase
	AndroidRule
}

DebuggableManifestRule checks for android:debuggable="true" in <application>. The debuggable flag should not be hardcoded in the manifest; it should be controlled by the build system.

func (*DebuggableManifestRule) Meta

type DeepLinkMissingAutoVerifyRule

type DeepLinkMissingAutoVerifyRule struct {
	ManifestBase
	AndroidRule
}

DeepLinkMissingAutoVerifyRule checks for web deep-link intent filters that are missing android:autoVerify="true".

func (*DeepLinkMissingAutoVerifyRule) Confidence

func (r *DeepLinkMissingAutoVerifyRule) Confidence() float64

func (*DeepLinkMissingAutoVerifyRule) Meta

type DefaultLocaleRule

type DefaultLocaleRule struct {
	FlatDispatchBase
	AndroidRule
}

DefaultLocaleRule detects String.format() without Locale, .toLowerCase()/.toUpperCase() without Locale.

func (*DefaultLocaleRule) Confidence

func (r *DefaultLocaleRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*DefaultLocaleRule) Meta

type DeferredAwaitInFinallyRule

type DeferredAwaitInFinallyRule struct {
	FlatDispatchBase
	BaseRule
}

DeferredAwaitInFinallyRule detects .await() calls inside finally blocks.

func (*DeferredAwaitInFinallyRule) Confidence

func (r *DeferredAwaitInFinallyRule) Confidence() float64

func (*DeferredAwaitInFinallyRule) Meta

type DependenciesInRootProjectRule

type DependenciesInRootProjectRule struct {
	GradleBase
	BaseRule

	AllowedConfigurations []string
}

DependenciesInRootProjectRule flags application/runtime dependencies declared directly in the root Gradle project instead of in an owning module.

func (*DependenciesInRootProjectRule) Confidence

func (r *DependenciesInRootProjectRule) Confidence() float64

func (*DependenciesInRootProjectRule) Meta

type DependencyFromBintrayRule

type DependencyFromBintrayRule struct {
	GradleBase
	BaseRule
}

DependencyFromBintrayRule flags Gradle repositories hosted on retired Bintray endpoints.

func (*DependencyFromBintrayRule) Confidence

func (r *DependencyFromBintrayRule) Confidence() float64

func (*DependencyFromBintrayRule) Meta

type DependencyFromHTTPRule

type DependencyFromHTTPRule struct {
	GradleBase
	BaseRule

	AllowLoopback bool
	AllowedHosts  []string
	AllowedUrls   []string
}

DependencyFromHTTPRule flags plaintext Gradle repository URLs.

func (*DependencyFromHTTPRule) Confidence

func (r *DependencyFromHTTPRule) Confidence() float64

func (*DependencyFromHTTPRule) Meta

type DependencyFromJcenterRule

type DependencyFromJcenterRule struct {
	GradleBase
	BaseRule
}

DependencyFromJcenterRule flags Gradle repositories that still use JCenter.

func (*DependencyFromJcenterRule) Confidence

func (r *DependencyFromJcenterRule) Confidence() float64

func (*DependencyFromJcenterRule) Meta

type DependencyLicenseIncompatibleRule

type DependencyLicenseIncompatibleRule struct {
	GradleBase
	BaseRule
	ProjectLicense string
}

DependencyLicenseIncompatibleRule flags external dependencies whose license is known to be incompatible with the project's declared license.

func (*DependencyLicenseIncompatibleRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Licensing rule. Detection relies on the embedded license registry and the configured project license; missing or stale registry entries can produce false negatives. Classified per roadmap/17.

type DependencyLicenseUnknownRule

type DependencyLicenseUnknownRule struct {
	GradleBase
	BaseRule
	RequireVerification bool
}

DependencyLicenseUnknownRule flags external dependencies that are not present in the embedded license registry when license verification is required.

func (*DependencyLicenseUnknownRule) Confidence

func (r *DependencyLicenseUnknownRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Licensing rule. Detection scans file headers and manifests for license markers via regex; custom or non-English headers can produce false negatives. Classified per roadmap/17.

type DependencySnapshotInReleaseRule

type DependencySnapshotInReleaseRule struct {
	GradleBase
	BaseRule

	AllowedSnapshots []string
	SuppressUntil    string
}

DependencySnapshotInReleaseRule flags release dependencies pinned to SNAPSHOT versions.

func (*DependencySnapshotInReleaseRule) Confidence

func (r *DependencySnapshotInReleaseRule) Confidence() float64

func (*DependencySnapshotInReleaseRule) Meta

type DependencyVerificationDisabledRule

type DependencyVerificationDisabledRule struct {
	BaseRule

	AllowLenient bool
}

DependencyVerificationDisabledRule flags Gradle dependency verification set to off or lenient.

func (*DependencyVerificationDisabledRule) Confidence

func (*DependencyVerificationDisabledRule) Meta

func (*DependencyVerificationDisabledRule) ModuleAwareNeeds

type DependencyWithoutGroupRule

type DependencyWithoutGroupRule struct {
	GradleBase
	BaseRule
}

DependencyWithoutGroupRule flags legacy name:version dependency coordinates.

func (*DependencyWithoutGroupRule) Confidence

func (r *DependencyWithoutGroupRule) Confidence() float64

func (*DependencyWithoutGroupRule) Meta

type DeprecatedBlockTagRule

type DeprecatedBlockTagRule struct {
	FlatDispatchBase
	BaseRule
}

DeprecatedBlockTagRule detects @deprecated in KDoc comments.

func (*DeprecatedBlockTagRule) Confidence

func (r *DeprecatedBlockTagRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*DeprecatedBlockTagRule) IsFixable

func (r *DeprecatedBlockTagRule) IsFixable() bool

func (*DeprecatedBlockTagRule) Meta

type DeprecatedDependencyRule

type DeprecatedDependencyRule struct {
	GradleBase
	AndroidRule
}

DeprecatedDependencyRule flags known deprecated libraries (e.g., support-v4). Delegates to the scanner's lintDeprecatedDependency.

func (*DeprecatedDependencyRule) Confidence

func (r *DeprecatedDependencyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*DeprecatedDependencyRule) Meta

type DeprecatedRule

type DeprecatedRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*DeprecatedRule) Confidence

func (r *DeprecatedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*DeprecatedRule) Meta

func (r *DeprecatedRule) Meta() api.RuleDescriptor

type DeprecationRule

type DeprecationRule struct {
	FlatDispatchBase
	BaseRule
	ExcludeImportStatements bool
}

func (*DeprecationRule) Confidence

func (r *DeprecationRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — matches on deprecation markers and annotations via pattern, with resolver-backed type checks used only when available. Classified per roadmap/17.

func (*DeprecationRule) Meta

type DestructuringDeclarationWithTooManyEntriesRule

type DestructuringDeclarationWithTooManyEntriesRule struct {
	FlatDispatchBase
	BaseRule
	MaxEntries int
}

DestructuringDeclarationWithTooManyEntriesRule limits destructuring entries.

func (*DestructuringDeclarationWithTooManyEntriesRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection uses structural pattern matching on expressions; the suggested rewrite's readability is a style call. Classified per roadmap/17.

func (*DestructuringDeclarationWithTooManyEntriesRule) Meta

type DeviceAdminManifestRule

type DeviceAdminManifestRule struct {
	ManifestBase
	AndroidRule
}

DeviceAdminManifestRule detects <receiver> elements with the android.app.admin.DEVICE_ADMIN action but missing the required <meta-data android:resource="@xml/device_admin"/> element.

func (*DeviceAdminManifestRule) Meta

type DiCycleDetectionRule

type DiCycleDetectionRule struct {
	FlatDispatchBase
	BaseRule
}

func (*DiCycleDetectionRule) Confidence

func (r *DiCycleDetectionRule) Confidence() float64

func (*DiCycleDetectionRule) Meta

type DisableBaselineAlignmentResourceRule

type DisableBaselineAlignmentResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

DisableBaselineAlignmentResourceRule detects LinearLayout views that have children with layout_weight but the parent does not set baselineAligned="false". Baseline alignment is expensive with weighted children.

func (*DisableBaselineAlignmentResourceRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*DisableBaselineAlignmentResourceRule) Meta

type DisableCertificatePinningRule

type DisableCertificatePinningRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*DisableCertificatePinningRule) Confidence

func (r *DisableCertificatePinningRule) Confidence() float64

func (*DisableCertificatePinningRule) Meta

type DispatchError

type DispatchError struct {
	RuleName   string
	FilePath   string
	Line       int
	PanicValue interface{}
}

DispatchError records a panic recovered during rule execution.

func (DispatchError) Error

func (e DispatchError) Error() string

type Dispatcher

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

Dispatcher runs per-file rule execution directly against api.Rule values. It classifies rules once in the constructor and keeps them in parallel slices indexed by FlatNode.Type for O(1) node dispatch, using the scanner's flat-type index.

Cross-file and module-aware rules are stored but NOT invoked inside Run — they require indexes that are only available once all files have been parsed. The main pipeline is expected to iterate CrossFileRules()/ModuleAwareRules() after the per-file pass.

func NewDispatcher

func NewDispatcher(rules []*api.Rule, resolver ...typeinfer.TypeResolver) *Dispatcher

NewDispatcher constructs a Dispatcher from the supplied v2 rules. An optional TypeResolver is wired through to any rule declaring NeedsResolver via that rule's SetResolverHook.

func (*Dispatcher) CrossFileRules

func (d *Dispatcher) CrossFileRules() []*api.Rule

CrossFileRules returns the cross-file rules stored on this dispatcher. The main pipeline invokes these after building the code index.

func (*Dispatcher) GradleRules

func (d *Dispatcher) GradleRules() []*api.Rule

GradleRules returns the Gradle rules stored on this dispatcher. The main pipeline invokes these via RunGradle once per parsed Gradle file.

func (*Dispatcher) IconRules

func (d *Dispatcher) IconRules() []*api.Rule

IconRules returns Android icon rules stored on this dispatcher.

func (*Dispatcher) ManifestRules

func (d *Dispatcher) ManifestRules() []*api.Rule

ManifestRules returns the manifest rules stored on this dispatcher.

func (*Dispatcher) ModuleAwareRules

func (d *Dispatcher) ModuleAwareRules() []*api.Rule

ModuleAwareRules returns the module-aware rules stored on this dispatcher. The main pipeline invokes these after building the per-module index.

func (*Dispatcher) ReportMissingCapabilities

func (d *Dispatcher) ReportMissingCapabilities(oracleAvailable bool, logger func(format string, args ...any))

ReportMissingCapabilities emits one diagnostic line per rule whose declared capabilities cannot be satisfied by the dispatcher's current wiring: NeedsResolver without a resolver, or an explicit KAA consumer when the caller indicates no oracle is configured.

The log format is:

verbose: skipped rule <ID>: NeedsResolver declared but no resolver configured
verbose: skipped rule <ID>: NeedsOracle declared but no oracle configured
verbose: skipped rule <ID>: oracle metadata declared but no oracle configured

A sync.Once guard inside the dispatcher ensures that even if multiple callers share the instance (CLI + LSP), the diagnostic is emitted at most once per run. Non-verbose paths pass a nil logger and stay silent.

func (*Dispatcher) ResourceRules

func (d *Dispatcher) ResourceRules() []*api.Rule

ResourceRules returns the resource rules stored on this dispatcher.

func (*Dispatcher) ResourceSourceRules

func (d *Dispatcher) ResourceSourceRules() []*api.Rule

ResourceSourceRules returns source AST rules that need the Android ResourceIndex. The Android phase invokes these after resource scanning.

func (*Dispatcher) Run

Run executes all per-file rules and returns findings in columnar form. Rule panics are logged to stderr.

func (*Dispatcher) RunColumnsWithStats

func (d *Dispatcher) RunColumnsWithStats(file *scanner.File) (scanner.FindingColumns, RunStats)

RunColumnsWithStats runs all per-file rules emitting findings directly into a FindingCollector, bypassing the intermediate []scanner.Finding accumulation. Rules emit via ctx.Emit which routes straight to the collector; the result is returned as columnar data.

func (*Dispatcher) RunGradle

func (d *Dispatcher) RunGradle(file *scanner.File, cfg *android.BuildConfig) scanner.FindingColumns

RunGradle runs every registered Gradle rule against a single parsed Gradle build script. The file argument carries path/content with Language == LangGradle; cfg is the parsed BuildConfig. Findings are filtered by the per-rule YAML excludes and the Languages filter. Panics are recovered and surfaced via stderr to match Run().

func (*Dispatcher) RunIcons

func (d *Dispatcher) RunIcons(file *scanner.File, idx *android.IconIndex) scanner.FindingColumns

RunIcons runs every registered icon rule against an IconIndex for a single res/ directory.

func (*Dispatcher) RunManifest

func (d *Dispatcher) RunManifest(file *scanner.File, m *manifest.Manifest) scanner.FindingColumns

RunManifest runs every registered manifest rule against a parsed AndroidManifest.xml. The api.Context.Manifest field is typed as interface{} to avoid an import cycle from the api package back into rules; the dispatcher itself takes a typed *manifest.Manifest.

func (*Dispatcher) RunResource

func (d *Dispatcher) RunResource(file *scanner.File, idx *android.ResourceIndex) scanner.FindingColumns

RunResource runs every registered resource rule against a merged ResourceIndex for a single res/ directory.

func (*Dispatcher) RunResourceSource

func (d *Dispatcher) RunResourceSource(file *scanner.File, idx *android.ResourceIndex) scanner.FindingColumns

RunResourceSource runs source AST rules that need the merged Android ResourceIndex. These rules are not part of the hot per-file dispatch phase because the resource index is assembled later in the Android phase.

func (*Dispatcher) RunWithStats

func (d *Dispatcher) RunWithStats(file *scanner.File) (scanner.FindingColumns, RunStats)

RunWithStats executes all per-file rules on a file and returns both findings in columnar form and coarse timing for each execution bucket.

func (*Dispatcher) SetJavaSemanticFacts

func (d *Dispatcher) SetJavaSemanticFacts(facts *javafacts.Facts)

SetJavaSemanticFacts wires optional javac-backed semantic facts into contexts created by this dispatcher.

func (*Dispatcher) SetLibraryFacts

func (d *Dispatcher) SetLibraryFacts(facts *librarymodel.Facts)

SetLibraryFacts wires project-wide library semantics into contexts created by this dispatcher.

func (*Dispatcher) Stats

func (d *Dispatcher) Stats() (dispatched, lineRules, crossFile, moduleAware int)

Stats returns per-family rule counts for logging.

type DocumentationOverPrivateFunctionRule

type DocumentationOverPrivateFunctionRule struct {
	FlatDispatchBase
	BaseRule
}

DocumentationOverPrivateFunctionRule detects KDoc on private functions.

func (*DocumentationOverPrivateFunctionRule) Confidence

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*DocumentationOverPrivateFunctionRule) IsFixable

Comments rules

func (*DocumentationOverPrivateFunctionRule) Meta

type DocumentationOverPrivatePropertyRule

type DocumentationOverPrivatePropertyRule struct {
	FlatDispatchBase
	BaseRule
}

DocumentationOverPrivatePropertyRule detects KDoc on private properties.

func (*DocumentationOverPrivatePropertyRule) Confidence

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*DocumentationOverPrivatePropertyRule) IsFixable

func (*DocumentationOverPrivatePropertyRule) Meta

type DontDowncastCollectionTypesRule

type DontDowncastCollectionTypesRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- DontDowncastCollectionTypesRule detects `as MutableList`, `as MutableMap`, etc. With type inference: uses ClassHierarchy on source and target of a cast to verify the source is a supertype of the target in the collection hierarchy. ---------------------------------------------------------------------------

func (*DontDowncastCollectionTypesRule) IsFixable

func (r *DontDowncastCollectionTypesRule) IsFixable() bool

Potential-bugs rules (new fixable)

func (*DontDowncastCollectionTypesRule) Meta

type DoubleMutabilityForCollectionRule

type DoubleMutabilityForCollectionRule struct {
	FlatDispatchBase
	BaseRule
	MutableTypes []string
}

--------------------------------------------------------------------------- DoubleMutabilityForCollectionRule detects var with mutable collection type. ---------------------------------------------------------------------------

func (*DoubleMutabilityForCollectionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. The rule uses a fixed allow-list of mutable-collection type names and factory function names; it correctly flags the common case (`var xs = mutableListOf<Foo>()`) with local AST/import evidence, but won't detect the pattern when the collection is returned from a wrapper function. Medium confidence matches the known scope-analysis gap.

func (*DoubleMutabilityForCollectionRule) IsFixable

func (r *DoubleMutabilityForCollectionRule) IsFixable() bool

func (*DoubleMutabilityForCollectionRule) Meta

type DoubleNegativeExpressionRule

type DoubleNegativeExpressionRule struct {
	FlatDispatchBase
	BaseRule
}

DoubleNegativeExpressionRule detects `!isNotEmpty()` etc.

func (*DoubleNegativeExpressionRule) Confidence

func (r *DoubleNegativeExpressionRule) Confidence() float64

Confidence: tier-1 — the detection is purely syntactic. prefix_expression with a `!` operator applied to a no-arg call whose callee starts with `isNot`/`isNon` is unambiguously a double negative.

func (*DoubleNegativeExpressionRule) IsFixable

func (r *DoubleNegativeExpressionRule) IsFixable() bool

func (*DoubleNegativeExpressionRule) Meta

type DoubleNegativeLambdaRule

type DoubleNegativeLambdaRule struct {
	FlatDispatchBase
	BaseRule
	// NegativeFunctions is an additional callee allowlist. Configured
	// names are treated as double-negation candidates alongside the
	// always-on `filterNot` and `none`.
	NegativeFunctions []string
}

DoubleNegativeLambdaRule detects `filterNot { !it }`, `none { !it }`.

func (*DoubleNegativeLambdaRule) Confidence

func (r *DoubleNegativeLambdaRule) Confidence() float64

Confidence: tier-1 syntactic — the shape `.filterNot { <negation> }` and `.none { <negation> }` where the lambda body is a single prefix-bang expression is an unambiguous double negative. We deliberately do NOT flag multi-statement lambdas or compound expressions where `!` appears inside a larger boolean expression.

func (*DoubleNegativeLambdaRule) IsFixable

func (r *DoubleNegativeLambdaRule) IsFixable() bool

func (*DoubleNegativeLambdaRule) Meta

type DrawAllocationRule

type DrawAllocationRule struct {
	FlatDispatchBase
	AndroidRule
}

DrawAllocationRule detects object allocations inside onDraw/draw methods. Uses AST dispatch on function_declaration to avoid brace-counting errors from string literals, comments, and multi-line signatures that broke the prior line-scan implementation.

func (*DrawAllocationRule) Confidence

func (r *DrawAllocationRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. AST-based detection scopes allocations to the onDraw/draw function body, eliminating the prior regex/brace-scan false positives from string literals, comments, and multi-line signatures. Unqualified type-name matching against the fixed allow-list keeps this pattern-based without KAA type resolution. Classified per roadmap/17.

func (*DrawAllocationRule) Meta

type DuplicateActivityManifestRule

type DuplicateActivityManifestRule struct {
	ManifestBase
	AndroidRule
}

DuplicateActivityManifestRule checks for activities registered more than once. Duplicate registrations cause subtle bugs because attribute declarations from the two elements are not merged.

func (*DuplicateActivityManifestRule) Meta

type DuplicateIDsResourceRule

type DuplicateIDsResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

DuplicateIDsResourceRule detects the same android:id used more than once in a single layout file.

func (*DuplicateIDsResourceRule) Confidence

func (r *DuplicateIDsResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*DuplicateIDsResourceRule) Meta

type DuplicateIncludedIDsResourceRule

type DuplicateIncludedIDsResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

DuplicateIncludedIDsResourceRule detects IDs that appear in multiple layout files. Since we don't resolve <include> tags, we flag IDs appearing in 3+ layouts as likely copy-paste duplicates that may cause runtime ID conflicts when layouts include each other.

func (*DuplicateIncludedIDsResourceRule) Confidence

func (r *DuplicateIncludedIDsResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*DuplicateIncludedIDsResourceRule) Meta

type DuplicateUsesFeatureManifestRule

type DuplicateUsesFeatureManifestRule struct {
	ManifestBase
	AndroidRule
}

DuplicateUsesFeatureManifestRule detects <uses-feature> elements with duplicate android:name values.

func (*DuplicateUsesFeatureManifestRule) Meta

type DynamicVersionRule

type DynamicVersionRule struct {
	GradleBase
	AndroidRule
}

DynamicVersionRule flags dependencies using partial wildcard versions such as "1.+" or "2.3.+", which create non-reproducible builds.

func (*DynamicVersionRule) Confidence

func (r *DynamicVersionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*DynamicVersionRule) Meta

DynamicVersionRule is also registered as rule ID "GradleDynamicVersion"; Meta() only represents the primary ID.

type EasterEggRule

type EasterEggRule struct{ AndroidRule }

EasterEggRule detects comments containing easter egg references.

func (*EasterEggRule) Confidence

func (r *EasterEggRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*EasterEggRule) Meta

func (r *EasterEggRule) Meta() api.RuleDescriptor

type ElseCaseInsteadOfExhaustiveWhenRule

type ElseCaseInsteadOfExhaustiveWhenRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- ElseCaseInsteadOfExhaustiveWhenRule detects when with else on enum/sealed. With type inference: checks if ALL sealed/enum variants are covered in the when branches. If they are, the else is truly unnecessary. Without resolver, falls back to the heuristic (flags any when-with-else that uses `is` checks). ---------------------------------------------------------------------------

func (*ElseCaseInsteadOfExhaustiveWhenRule) Confidence

Confidence reports a tier-2 (medium) base confidence — with the resolver it checks if sealed/enum variants are fully covered; fallback flags any when-with-else-using-is, which is noisier. Classified per roadmap/17.

func (*ElseCaseInsteadOfExhaustiveWhenRule) Meta

type EmptyCatchBlockRule

type EmptyCatchBlockRule struct {
	FlatDispatchBase
	BaseRule
	AllowedExceptionNameRegex *regexp.Regexp // exception names matching this are allowed to be empty
}

EmptyCatchBlockRule detects catch blocks with empty body.

func (*EmptyCatchBlockRule) Confidence

func (r *EmptyCatchBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyCatchBlockRule) IsFixable

func (r *EmptyCatchBlockRule) IsFixable() bool

func (*EmptyCatchBlockRule) Meta

type EmptyClassBlockRule

type EmptyClassBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyClassBlockRule detects classes with empty body.

func (*EmptyClassBlockRule) Confidence

func (r *EmptyClassBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyClassBlockRule) IsFixable

func (r *EmptyClassBlockRule) IsFixable() bool

func (*EmptyClassBlockRule) Meta

type EmptyDefaultConstructorRule

type EmptyDefaultConstructorRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyDefaultConstructorRule detects explicit empty default constructors.

func (*EmptyDefaultConstructorRule) Confidence

func (r *EmptyDefaultConstructorRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyDefaultConstructorRule) IsFixable

func (r *EmptyDefaultConstructorRule) IsFixable() bool

Empty-blocks rules

func (*EmptyDefaultConstructorRule) Meta

type EmptyDoWhileBlockRule

type EmptyDoWhileBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyDoWhileBlockRule detects do-while loops with empty body.

func (*EmptyDoWhileBlockRule) Confidence

func (r *EmptyDoWhileBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyDoWhileBlockRule) IsFixable

func (r *EmptyDoWhileBlockRule) IsFixable() bool

func (*EmptyDoWhileBlockRule) Meta

type EmptyElseBlockRule

type EmptyElseBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyElseBlockRule detects else blocks with empty body.

func (*EmptyElseBlockRule) Confidence

func (r *EmptyElseBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyElseBlockRule) IsFixable

func (r *EmptyElseBlockRule) IsFixable() bool

func (*EmptyElseBlockRule) Meta

type EmptyFinallyBlockRule

type EmptyFinallyBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyFinallyBlockRule detects finally blocks with empty body.

func (*EmptyFinallyBlockRule) Confidence

func (r *EmptyFinallyBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyFinallyBlockRule) IsFixable

func (r *EmptyFinallyBlockRule) IsFixable() bool

func (*EmptyFinallyBlockRule) Meta

type EmptyForBlockRule

type EmptyForBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyForBlockRule detects for loops with empty body.

func (*EmptyForBlockRule) Confidence

func (r *EmptyForBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyForBlockRule) IsFixable

func (r *EmptyForBlockRule) IsFixable() bool

func (*EmptyForBlockRule) Meta

type EmptyFunctionBlockRule

type EmptyFunctionBlockRule struct {
	FlatDispatchBase
	BaseRule
	IgnoreOverridden bool // if true, skip override functions with empty body
}

EmptyFunctionBlockRule detects functions with empty body.

func (*EmptyFunctionBlockRule) Confidence

func (r *EmptyFunctionBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyFunctionBlockRule) IsFixable

func (r *EmptyFunctionBlockRule) IsFixable() bool

func (*EmptyFunctionBlockRule) Meta

type EmptyIfBlockRule

type EmptyIfBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyIfBlockRule detects if blocks with empty body.

func (*EmptyIfBlockRule) Confidence

func (r *EmptyIfBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyIfBlockRule) IsFixable

func (r *EmptyIfBlockRule) IsFixable() bool

func (*EmptyIfBlockRule) Meta

type EmptyInitBlockRule

type EmptyInitBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyInitBlockRule detects init blocks with empty body.

func (*EmptyInitBlockRule) Confidence

func (r *EmptyInitBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyInitBlockRule) IsFixable

func (r *EmptyInitBlockRule) IsFixable() bool

func (*EmptyInitBlockRule) Meta

type EmptyKotlinFileRule

type EmptyKotlinFileRule struct {
	LineBase
	BaseRule
}

EmptyKotlinFileRule detects files with no meaningful code.

func (*EmptyKotlinFileRule) Confidence

func (r *EmptyKotlinFileRule) Confidence() float64

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 — the check walks the AST root for any non-package/import/ comment child, which is a precise structural determination.

func (*EmptyKotlinFileRule) Meta

type EmptySecondaryConstructorRule

type EmptySecondaryConstructorRule struct {
	FlatDispatchBase
	BaseRule
}

EmptySecondaryConstructorRule detects secondary constructors with empty body.

func (*EmptySecondaryConstructorRule) Confidence

func (r *EmptySecondaryConstructorRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptySecondaryConstructorRule) IsFixable

func (r *EmptySecondaryConstructorRule) IsFixable() bool

func (*EmptySecondaryConstructorRule) Meta

type EmptyTryBlockRule

type EmptyTryBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyTryBlockRule detects try blocks with empty body.

func (*EmptyTryBlockRule) Confidence

func (r *EmptyTryBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyTryBlockRule) IsFixable

func (r *EmptyTryBlockRule) IsFixable() bool

func (*EmptyTryBlockRule) Meta

type EmptyWhenBlockRule

type EmptyWhenBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyWhenBlockRule detects when expressions with empty body.

func (*EmptyWhenBlockRule) Confidence

func (r *EmptyWhenBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyWhenBlockRule) IsFixable

func (r *EmptyWhenBlockRule) IsFixable() bool

func (*EmptyWhenBlockRule) Meta

type EmptyWhileBlockRule

type EmptyWhileBlockRule struct {
	FlatDispatchBase
	BaseRule
}

EmptyWhileBlockRule detects while loops with empty body.

func (*EmptyWhileBlockRule) Confidence

func (r *EmptyWhileBlockRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Empty-block rule. Detection checks AST child count for statements/expressions inside a block — purely structural. No heuristic path. Classified per roadmap/17.

func (*EmptyWhileBlockRule) IsFixable

func (r *EmptyWhileBlockRule) IsFixable() bool

func (*EmptyWhileBlockRule) Meta

type EndOfSentenceFormatRule

type EndOfSentenceFormatRule struct {
	FlatDispatchBase
	BaseRule
	// Pattern is the regex applied to the first line of a KDoc to verify
	// it ends with proper punctuation. Configurable via the
	// `endOfSentenceFormat` YAML option.
	Pattern *regexp.Regexp
}

EndOfSentenceFormatRule checks KDoc first sentence ends with proper punctuation.

func (*EndOfSentenceFormatRule) Confidence

func (r *EndOfSentenceFormatRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*EndOfSentenceFormatRule) Meta

type EntityMutableColumnRule

type EntityMutableColumnRule struct {
	FlatDispatchBase
	BaseRule
}

EntityMutableColumnRule detects Room @Entity class declarations whose primary-constructor parameters use `var`, preventing straightforward copy-on-write semantics for entity rows.

func (*EntityMutableColumnRule) Confidence

func (r *EntityMutableColumnRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names and function calls without confirming the declared type is a Room DAO or entity. Classified per roadmap/17.

func (*EntityMutableColumnRule) Meta

type EntityPrimaryKeyNotStableRule

type EntityPrimaryKeyNotStableRule struct {
	FlatDispatchBase
	BaseRule
}

EntityPrimaryKeyNotStableRule detects Room @Entity primary keys declared as `var` without `autoGenerate = true`. A mutable primary key breaks equals/hashCode contracts when the row is inserted and assigned a real id.

func (*EntityPrimaryKeyNotStableRule) Confidence

func (r *EntityPrimaryKeyNotStableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names without confirming the declared type is a Room entity. Classified per roadmap/17.

func (*EntityPrimaryKeyNotStableRule) Meta

type EnumNamingRule

type EnumNamingRule struct {
	FlatDispatchBase
	BaseRule
	Pattern *regexp.Regexp
}

EnumNamingRule checks enum entry names.

func (*EnumNamingRule) Confidence

func (r *EnumNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*EnumNamingRule) Meta

func (r *EnumNamingRule) Meta() api.RuleDescriptor

type EqualsAlwaysReturnsTrueOrFalseRule

type EqualsAlwaysReturnsTrueOrFalseRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- EqualsAlwaysReturnsTrueOrFalseRule detects equals() that always returns true/false. ---------------------------------------------------------------------------

func (*EqualsAlwaysReturnsTrueOrFalseRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Potential-bugs types rule. Detection pattern-matches type-related constructs; resolver usage when available improves precision but fallback is heuristic. Classified per roadmap/17.

func (*EqualsAlwaysReturnsTrueOrFalseRule) Meta

type EqualsNullCallRule

type EqualsNullCallRule struct {
	FlatDispatchBase
	BaseRule
}

func (*EqualsNullCallRule) Confidence

func (r *EqualsNullCallRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*EqualsNullCallRule) IsFixable

func (r *EqualsNullCallRule) IsFixable() bool

func (*EqualsNullCallRule) Meta

type EqualsOnSignatureLineRule

type EqualsOnSignatureLineRule struct {
	LineBase
	BaseRule
}

EqualsOnSignatureLineRule detects `=` on the next line of a function signature.

func (*EqualsOnSignatureLineRule) Confidence

func (r *EqualsOnSignatureLineRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/formatting rule. Detection is pattern or regex based on line text; deterministic byte checks have been promoted to tier-1 separately. Classified per roadmap/17.

func (*EqualsOnSignatureLineRule) IsFixable

func (r *EqualsOnSignatureLineRule) IsFixable() bool

func (*EqualsOnSignatureLineRule) Meta

type EqualsWithHashCodeExistRule

type EqualsWithHashCodeExistRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- EqualsWithHashCodeExistRule detects equals without hashCode or vice versa. ---------------------------------------------------------------------------

func (*EqualsWithHashCodeExistRule) Confidence

func (r *EqualsWithHashCodeExistRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs types rule. Detection pattern-matches type-related constructs; resolver usage when available improves precision but fallback is heuristic. Classified per roadmap/17.

func (*EqualsWithHashCodeExistRule) Meta

type ErrorUsageWithThrowableRule

type ErrorUsageWithThrowableRule struct {
	FlatDispatchBase
	BaseRule
}

ErrorUsageWithThrowableRule detects error(throwable) calls.

func (*ErrorUsageWithThrowableRule) Confidence

func (r *ErrorUsageWithThrowableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*ErrorUsageWithThrowableRule) Meta

type ExceptionRaisedInUnexpectedLocationRule

type ExceptionRaisedInUnexpectedLocationRule struct {
	FlatDispatchBase
	BaseRule
	// MethodNames is the list of function names where throwing is treated
	// as a finding. Configurable via the `methodNames` YAML option.
	// Default: equals, hashCode, toString, finalize.
	MethodNames []string
}

ExceptionRaisedInUnexpectedLocationRule detects throw inside equals/hashCode/toString/finalize.

func (*ExceptionRaisedInUnexpectedLocationRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*ExceptionRaisedInUnexpectedLocationRule) Meta

type ExitOutsideMainRule

type ExitOutsideMainRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- ExitOutsideMainRule detects exitProcess()/System.exit() outside main. ---------------------------------------------------------------------------

func (*ExitOutsideMainRule) Confidence

func (r *ExitOutsideMainRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs lifecycle rule. Detection matches framework lifecycle hook shapes by name and annotation; project-specific wrappers can escape detection. Classified per roadmap/17.

func (*ExitOutsideMainRule) Meta

type ExplicitCollectionElementAccessMethodRule

type ExplicitCollectionElementAccessMethodRule struct {
	FlatDispatchBase
	BaseRule
}

func (*ExplicitCollectionElementAccessMethodRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*ExplicitCollectionElementAccessMethodRule) IsFixable

func (*ExplicitCollectionElementAccessMethodRule) Meta

type ExplicitGarbageCollectionCallRule

type ExplicitGarbageCollectionCallRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- ExplicitGarbageCollectionCallRule detects System.gc() calls. ---------------------------------------------------------------------------

func (*ExplicitGarbageCollectionCallRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Potential-bugs lifecycle rule. Detection matches framework lifecycle hook shapes by name and annotation; project-specific wrappers can escape detection. Classified per roadmap/17.

func (*ExplicitGarbageCollectionCallRule) IsFixable

func (r *ExplicitGarbageCollectionCallRule) IsFixable() bool

func (*ExplicitGarbageCollectionCallRule) Meta

type ExplicitItLambdaMultipleParametersRule

type ExplicitItLambdaMultipleParametersRule struct {
	FlatDispatchBase
	BaseRule
}

ExplicitItLambdaMultipleParametersRule detects 'it' as a parameter name in lambdas with multiple parameters. Naming a parameter 'it' is confusing when there are other parameters because 'it' normally refers to the implicit single parameter.

func (*ExplicitItLambdaMultipleParametersRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection is pattern-based and the preferred form is a style preference. Classified per roadmap/17.

func (*ExplicitItLambdaMultipleParametersRule) IsFixable

ExplicitItLambdaMultipleParameters: naming the replacement parameter requires author intent; not fixable.

func (*ExplicitItLambdaMultipleParametersRule) Meta

type ExplicitItLambdaParameterRule

type ExplicitItLambdaParameterRule struct {
	FlatDispatchBase
	BaseRule
}

ExplicitItLambdaParameterRule detects `{ it -> ... }` using AST-based analysis. It finds lambda_literal nodes with exactly one parameter named "it" and flags them. When the parameter has a type annotation (e.g. `{ it: Int -> ... }`), a different message is used because the parameter cannot simply be removed.

func (*ExplicitItLambdaParameterRule) Confidence

func (r *ExplicitItLambdaParameterRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection is pattern-based and the preferred form is a style preference. Classified per roadmap/17.

func (*ExplicitItLambdaParameterRule) IsFixable

func (r *ExplicitItLambdaParameterRule) IsFixable() bool

func (*ExplicitItLambdaParameterRule) Meta

type ExportedContentProviderRule

type ExportedContentProviderRule struct {
	FlatDispatchBase
	AndroidRule
}

ExportedContentProviderRule detects exported content providers without permission.

func (*ExportedContentProviderRule) Confidence

func (r *ExportedContentProviderRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ExportedContentProviderRule) Meta

type ExportedPreferenceActivityManifestRule

type ExportedPreferenceActivityManifestRule struct {
	ManifestBase
	AndroidRule
}

ExportedPreferenceActivityManifestRule detects activities that likely extend PreferenceActivity and are exported. Exported PreferenceActivity subclasses can be exploited to load arbitrary fragment classes.

func (*ExportedPreferenceActivityManifestRule) Meta

type ExportedReceiverRule

type ExportedReceiverRule struct {
	FlatDispatchBase
	AndroidRule
}

ExportedReceiverRule detects exported receivers without permission.

func (*ExportedReceiverRule) Confidence

func (r *ExportedReceiverRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ExportedReceiverRule) Meta

type ExportedServiceManifestRule

type ExportedServiceManifestRule struct {
	ManifestBase
	AndroidRule
}

ExportedServiceManifestRule checks for exported services without a permission. Similar to ExportedWithoutPermission but specifically targets services.

func (*ExportedServiceManifestRule) Meta

type ExportedServiceRule

type ExportedServiceRule struct {
	LineBase
	AndroidRule
}

ExportedServiceRule detects exported services/receivers without permission.

func (*ExportedServiceRule) Confidence

func (r *ExportedServiceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ExportedServiceRule) Meta

type ExportedWithoutPermissionRule

type ExportedWithoutPermissionRule struct {
	ManifestBase
	AndroidRule
}

ExportedWithoutPermissionRule checks for components that are explicitly exported (android:exported="true") but do not declare a permission.

func (*ExportedWithoutPermissionRule) Meta

type ExpressionBodySyntaxRule

type ExpressionBodySyntaxRule struct {
	FlatDispatchBase
	BaseRule
	IncludeLineWrapping bool
}

ExpressionBodySyntaxRule detects single-expression functions that could use = syntax.

func (*ExpressionBodySyntaxRule) Confidence

func (r *ExpressionBodySyntaxRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection is pattern-based and the preferred form is a style preference. Classified per roadmap/17.

func (*ExpressionBodySyntaxRule) IsFixable

func (r *ExpressionBodySyntaxRule) IsFixable() bool

func (*ExpressionBodySyntaxRule) Meta

type ExtraTextResourceRule

type ExtraTextResourceRule struct {
	ValuesExtraTextResourceBase
	AndroidRule
}

ExtraTextResourceRule detects extraneous text content between elements in values XML files. Stray text in <resources> is usually a copy-paste error.

func (*ExtraTextResourceRule) Confidence

func (r *ExtraTextResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*ExtraTextResourceRule) Meta

type FanInFanOutHotspotRule

type FanInFanOutHotspotRule struct {
	BaseRule
	AllowedFanIn            int
	IgnoreCommentReferences bool
}

FanInFanOutHotspotRule reports class-like declarations with unusually high fan-in across the project. This first slice handles threshold-based fan-in; a later pass can layer complexity scoring on the same substrate.

func (*FanInFanOutHotspotRule) Confidence

func (r *FanInFanOutHotspotRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Hotspot rule. Detection uses cross-file fan-in/fan-out metrics whose threshold is a project-sensitive heuristic. Classified per roadmap/17.

func (*FanInFanOutHotspotRule) Meta

type FieldGetterRule

type FieldGetterRule struct {
	FlatDispatchBase
	AndroidRule
}

FieldGetterRule detects using getter instead of direct field access in loops.

func (*FieldGetterRule) Confidence

func (r *FieldGetterRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*FieldGetterRule) Meta

func (*FieldGetterRule) NodeTypes

func (r *FieldGetterRule) NodeTypes() []string

type FileFromUntrustedPathRule

type FileFromUntrustedPathRule struct {
	FlatDispatchBase
	BaseRule
}

FileFromUntrustedPathRule detects File(parent, child) construction inside extract/upload/download-style functions where child is either a literal with parent traversal (`..`) or a non-literal path segment without an obvious canonical-path containment check.

func (*FileFromUntrustedPathRule) Confidence

func (r *FileFromUntrustedPathRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Security rule. Detection pattern-matches known-insecure API shapes and argument literals without confirming the receiver type. Classified per roadmap/17.

func (*FileFromUntrustedPathRule) Meta

type FirebaseRemoteConfigDefaultsWithPiiRule

type FirebaseRemoteConfigDefaultsWithPiiRule struct {
	FlatDispatchBase
	BaseRule
}

FirebaseRemoteConfigDefaultsWithPiiRule flags setDefaults/setDefaultsAsync calls whose map keys match PII patterns.

func (*FirebaseRemoteConfigDefaultsWithPiiRule) Confidence

func (*FirebaseRemoteConfigDefaultsWithPiiRule) Meta

type FixLevel

type FixLevel int

FixLevel indicates how safe an auto-fix is.

const (
	// FixCosmetic: whitespace, formatting, comments only. Cannot change behavior.
	FixCosmetic FixLevel = 1
	// FixIdiomatic: idiomatic transforms producing semantically equivalent code.
	FixIdiomatic FixLevel = 2
	// FixSemantic: correct in most cases but could change edge-case behavior
	// (reflection, serialization, binary compatibility, identity semantics).
	FixSemantic FixLevel = 3
)

func GetV2FixLevel

func GetV2FixLevel(r *api.Rule) (FixLevel, bool)

GetV2FixLevel returns the fix level encoded on a rule. Returns (0, false) when the rule is not fixable.

func ParseFixLevel

func ParseFixLevel(s string) (FixLevel, bool)

ParseFixLevel parses a fix level string.

func (FixLevel) String

func (l FixLevel) String() string

type FlatDispatchBase

type FlatDispatchBase = base.FlatDispatchBase

type FloatMathRule

type FloatMathRule struct {
	FlatDispatchBase
	AndroidRule
}

FloatMathRule detects deprecated FloatMath usage via AST dispatch.

func (*FloatMathRule) Confidence

func (r *FloatMathRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence for structural match. With type resolver verifying FQN: 1.0. Classified per roadmap/17.

func (*FloatMathRule) Meta

func (r *FloatMathRule) Meta() api.RuleDescriptor

func (*FloatMathRule) NodeTypes

func (r *FloatMathRule) NodeTypes() []string

type FlowWithoutFlowOnRule

type FlowWithoutFlowOnRule struct {
	FlatDispatchBase
	BaseRule
}

FlowWithoutFlowOnRule detects flow chains with collect but no flowOn.

func (*FlowWithoutFlowOnRule) Confidence

func (r *FlowWithoutFlowOnRule) Confidence() float64

func (*FlowWithoutFlowOnRule) Meta

type ForEachOnRangeRule

type ForEachOnRangeRule struct {
	FlatDispatchBase
	BaseRule
}

ForEachOnRangeRule detects (range).forEach patterns using AST dispatch: .., rangeTo, until, downTo, ..< on any literal type (int, long, char, unsigned) and through chained calls like .reversed(), .step().

func (*ForEachOnRangeRule) Confidence

func (r *ForEachOnRangeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Performance rule. Detection pattern-matches anti-patterns (allocation in loops, primitive boxing, collection chains) with optional resolver support; fallback is heuristic. Classified per roadmap/17.

func (*ForEachOnRangeRule) IsFixable

func (r *ForEachOnRangeRule) IsFixable() bool

Performance rules (new fixable)

func (*ForEachOnRangeRule) Meta

type ForbiddenAnnotationRule

type ForbiddenAnnotationRule struct {
	FlatDispatchBase
	BaseRule
	Annotations []string
}

ForbiddenAnnotationRule detects annotations that should not be used.

func (*ForbiddenAnnotationRule) Confidence

func (r *ForbiddenAnnotationRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*ForbiddenAnnotationRule) IsFixable

func (r *ForbiddenAnnotationRule) IsFixable() bool

func (*ForbiddenAnnotationRule) Meta

type ForbiddenClassNameRule

type ForbiddenClassNameRule struct {
	FlatDispatchBase
	BaseRule
	ForbiddenNames []string
}

ForbiddenClassNameRule flags disallowed class names.

func (*ForbiddenClassNameRule) Confidence

func (r *ForbiddenClassNameRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*ForbiddenClassNameRule) Meta

type ForbiddenCommentRule

type ForbiddenCommentRule struct {
	FlatDispatchBase
	BaseRule
	Comments        []string       // forbidden comment markers
	AllowedPatterns *regexp.Regexp // regex; comments matching this are allowed
}

ForbiddenCommentRule detects TODO:, FIXME:, STOPSHIP: markers.

func (*ForbiddenCommentRule) Confidence

func (r *ForbiddenCommentRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*ForbiddenCommentRule) IsFixable

func (r *ForbiddenCommentRule) IsFixable() bool

func (*ForbiddenCommentRule) Meta

type ForbiddenEntry

type ForbiddenEntry struct {
	Value  string
	Reason string
}

ForbiddenEntry pairs a forbidden value with an optional reason.

type ForbiddenImportRule

type ForbiddenImportRule struct {
	FlatDispatchBase
	BaseRule
	Patterns         []string // kept for backward compat; same as ForbiddenImports
	ForbiddenImports []string
	AllowedImports   []string
}

ForbiddenImportRule detects banned import patterns.

func (*ForbiddenImportRule) Confidence

func (r *ForbiddenImportRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*ForbiddenImportRule) IsFixable

func (r *ForbiddenImportRule) IsFixable() bool

func (*ForbiddenImportRule) Meta

Meta returns the descriptor for ForbiddenImportRule.

type ForbiddenMethodCallRule

type ForbiddenMethodCallRule struct {
	FlatDispatchBase
	BaseRule
	Methods []string // simple list kept for backward compat
}

ForbiddenMethodCallRule detects banned method calls.

func (*ForbiddenMethodCallRule) Confidence

func (r *ForbiddenMethodCallRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*ForbiddenMethodCallRule) IsFixable

func (r *ForbiddenMethodCallRule) IsFixable() bool

Style2 fixable rules (batch 6)

func (*ForbiddenMethodCallRule) Meta

type ForbiddenNamedParamRule

type ForbiddenNamedParamRule struct {
	FlatDispatchBase
	BaseRule
	Methods []string
}

ForbiddenNamedParamRule detects named parameters in certain function calls.

func (*ForbiddenNamedParamRule) Confidence

func (r *ForbiddenNamedParamRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*ForbiddenNamedParamRule) Meta

type ForbiddenOptInRule

type ForbiddenOptInRule struct {
	FlatDispatchBase
	BaseRule
	MarkerClasses []string // specific marker classes to forbid; empty = all @OptIn
}

ForbiddenOptInRule detects @OptIn annotations.

func (*ForbiddenOptInRule) Confidence

func (r *ForbiddenOptInRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*ForbiddenOptInRule) IsFixable

func (r *ForbiddenOptInRule) IsFixable() bool

func (*ForbiddenOptInRule) Meta

type ForbiddenPublicDataClassRule

type ForbiddenPublicDataClassRule struct {
	FlatDispatchBase
	BaseRule
}

ForbiddenPublicDataClassRule detects public data classes in library code. Data classes expose their properties as part of the API, making them hard to evolve.

func (*ForbiddenPublicDataClassRule) Confidence

func (r *ForbiddenPublicDataClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Library-hygiene rule. Detection matches on known library package names and API shapes without confirming the actual import target. Classified per roadmap/17.

func (*ForbiddenPublicDataClassRule) Meta

type ForbiddenSuppressRule

type ForbiddenSuppressRule struct {
	FlatDispatchBase
	BaseRule
	Rules []string // specific suppressed rules to forbid; empty = all @Suppress
}

ForbiddenSuppressRule detects @Suppress annotations.

func (*ForbiddenSuppressRule) Confidence

func (r *ForbiddenSuppressRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*ForbiddenSuppressRule) IsFixable

func (r *ForbiddenSuppressRule) IsFixable() bool

func (*ForbiddenSuppressRule) Meta

type ForbiddenVoidRule

type ForbiddenVoidRule struct {
	FlatDispatchBase
	BaseRule
	IgnoreOverridden      bool
	IgnoreUsageInGenerics bool
}

ForbiddenVoidRule detects Void type usage.

func (*ForbiddenVoidRule) Confidence

func (r *ForbiddenVoidRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*ForbiddenVoidRule) IsFixable

func (r *ForbiddenVoidRule) IsFixable() bool

func (*ForbiddenVoidRule) Meta

type ForeignKeyWithoutOnDeleteRule

type ForeignKeyWithoutOnDeleteRule struct {
	FlatDispatchBase
	BaseRule
}

ForeignKeyWithoutOnDeleteRule detects Room @ForeignKey(...) constructions that omit the named onDelete argument, falling back to NO_ACTION.

func (*ForeignKeyWithoutOnDeleteRule) Confidence

func (r *ForeignKeyWithoutOnDeleteRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Detection is name-based and may match unrelated ForeignKey constructors.

func (*ForeignKeyWithoutOnDeleteRule) Meta

type FragmentConstructorRule

type FragmentConstructorRule struct {
	FlatDispatchBase
	AndroidRule
}

FragmentConstructorRule flags Fragment subclasses that have non-default (parameterized) constructors without a no-arg constructor. The Android framework re-instantiates fragments via reflection using the no-arg ctor.

func (*FragmentConstructorRule) Confidence

func (r *FragmentConstructorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*FragmentConstructorRule) Meta

type FullBackupContentManifestRule

type FullBackupContentManifestRule struct {
	ManifestBase
	AndroidRule
}

FullBackupContentManifestRule detects issues with the fullBackupContent attribute. When allowBackup is true and targetSdk >= 23, the application should declare fullBackupContent to control what gets backed up.

func (*FullBackupContentManifestRule) Meta

type FunctionComplexity

type FunctionComplexity struct {
	Cognitive  int
	Cyclomatic int
}

func FunctionComplexities

func FunctionComplexities(file *scanner.File) []FunctionComplexity

type FunctionNameMaxLengthRule

type FunctionNameMaxLengthRule struct {
	FlatDispatchBase
	BaseRule
	MaxLength int
}

FunctionNameMaxLengthRule flags function names exceeding a max length.

func (*FunctionNameMaxLengthRule) Confidence

func (r *FunctionNameMaxLengthRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*FunctionNameMaxLengthRule) Meta

type FunctionNameMinLengthRule

type FunctionNameMinLengthRule struct {
	FlatDispatchBase
	BaseRule
	MinLength int
}

FunctionNameMinLengthRule flags function names below a min length.

func (*FunctionNameMinLengthRule) Confidence

func (r *FunctionNameMinLengthRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*FunctionNameMinLengthRule) Meta

type FunctionNamingRule

type FunctionNamingRule struct {
	FlatDispatchBase
	BaseRule
	Pattern               *regexp.Regexp
	IgnoreAnnotated       []string
	CustomPreviewWildcard bool
	CustomPreviewPrefixes []string
	AllowBacktickNames    bool           // if true (default), backtick-quoted names are skipped
	ExcludeClassPattern   *regexp.Regexp // classes matching this are excluded
}

FunctionNamingRule checks function names match a pattern.

func (*FunctionNamingRule) Confidence

func (r *FunctionNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*FunctionNamingRule) Meta

type FunctionOnlyReturningConstantRule

type FunctionOnlyReturningConstantRule struct {
	FlatDispatchBase
	BaseRule
	ExcludedFunctions         []string
	IgnoreOverridableFunction bool
	IgnoreActualFunction      bool
}

FunctionOnlyReturningConstantRule detects functions that only return a constant.

func (*FunctionOnlyReturningConstantRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection is pattern-based and the preferred form is a style preference. Classified per roadmap/17.

func (*FunctionOnlyReturningConstantRule) IsFixable

func (r *FunctionOnlyReturningConstantRule) IsFixable() bool

FunctionOnlyReturningConstant: replacing a block body with an expression body needs the constant-only analysis the rule already does, but the current Check() never populates Fix. Advertised as not-fixable until the body-rewrite helper lands.

func (*FunctionOnlyReturningConstantRule) Meta

type FunctionParameterNamingRule

type FunctionParameterNamingRule struct {
	FlatDispatchBase
	BaseRule
	Pattern             *regexp.Regexp
	ExcludeClassPattern *regexp.Regexp
}

FunctionParameterNamingRule checks function parameter names.

func (*FunctionParameterNamingRule) Confidence

func (r *FunctionParameterNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*FunctionParameterNamingRule) Meta

type GetInstanceRule

type GetInstanceRule struct {
	FlatDispatchBase
	AndroidRule
}

GetInstanceRule detects Cipher.getInstance with insecure algorithms (ECB, DES).

func (*GetInstanceRule) Confidence

func (r *GetInstanceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. AST-based detection resolves the call shape structurally (call_expression → navigation_expression(Cipher.getInstance) → string_literal arg) and confirms the receiver is javax.crypto.Cipher via import presence or the absence of a same-file user-defined Cipher class. Algorithm inspection uses the literal's parsed content, not regex slicing.

func (*GetInstanceRule) Meta

type GetSignaturesRule

type GetSignaturesRule struct {
	FlatDispatchBase
	AndroidRule
}

GetSignaturesRule flags use of the deprecated PackageManager.GET_SIGNATURES constant. GET_SIGNING_CERTIFICATES should be used instead (API 28+).

func (*GetSignaturesRule) Confidence

func (r *GetSignaturesRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*GetSignaturesRule) Meta

type GifUsageRule

type GifUsageRule struct {
	IconResourceBase
	AndroidRule
}

GifUsageRule detects GIF files in resources.

func (*GifUsageRule) Confidence

func (r *GifUsageRule) Confidence() float64

func (*GifUsageRule) Meta

func (r *GifUsageRule) Meta() api.RuleDescriptor

type GlobalCoroutineUsageRule

type GlobalCoroutineUsageRule struct {
	FlatDispatchBase
	BaseRule
}

GlobalCoroutineUsageRule detects GlobalScope.launch/async and direct GlobalScope references.

func (*GlobalCoroutineUsageRule) Confidence

func (r *GlobalCoroutineUsageRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Coroutines rule. Detection matches kotlinx.coroutines call shapes via name lists and structural patterns; project wrappers can escape or collide. Classified per roadmap/17.

func (*GlobalCoroutineUsageRule) Description

func (*GlobalCoroutineUsageRule) Description() string

Description implements DescriptionProvider.

func (*GlobalCoroutineUsageRule) IsFixable

func (r *GlobalCoroutineUsageRule) IsFixable() bool

Coroutines rules (new fixable)

func (*GlobalCoroutineUsageRule) Meta

type GlobalScopeLaunchInViewModelRule

type GlobalScopeLaunchInViewModelRule struct {
	FlatDispatchBase
	BaseRule
}

GlobalScopeLaunchInViewModelRule detects GlobalScope.launch in ViewModel/Presenter classes.

func (*GlobalScopeLaunchInViewModelRule) Confidence

func (r *GlobalScopeLaunchInViewModelRule) Confidence() float64

func (*GlobalScopeLaunchInViewModelRule) Meta

type GodClassOrModuleRule

type GodClassOrModuleRule struct {
	LineBase
	BaseRule
	AllowedDistinctPackages int
}

GodClassOrModuleRule reports Kotlin source files that import from an unusually broad set of packages. This first slice models the "module" side of the concept; class-level ownership can reuse the same thresholding approach with AST ownership in a later iteration.

func (*GodClassOrModuleRule) Confidence

func (r *GodClassOrModuleRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Hotspot rule. Detection uses cross-file fan-in/fan-out metrics whose threshold is a project-sensitive heuristic. Classified per roadmap/17.

func (*GodClassOrModuleRule) Meta

type GoogleAPIKeyInResourcesRule

type GoogleAPIKeyInResourcesRule struct {
	ValuesStringsResourceBase
	BaseRule
}

GoogleAPIKeyInResourcesRule detects string resources whose names suggest they embed a Google API key directly in XML instead of referencing a build-time injected string resource.

func (*GoogleAPIKeyInResourcesRule) Confidence

func (r *GoogleAPIKeyInResourcesRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*GoogleAPIKeyInResourcesRule) Meta

type GoogleAppIndexingDeepLinkErrorManifestRule

type GoogleAppIndexingDeepLinkErrorManifestRule struct {
	ManifestBase
	AndroidRule
}

GoogleAppIndexingDeepLinkErrorManifestRule detects deep link data elements with malformed URIs — specifically, data elements that declare a scheme but no host. A URI with a scheme but no host is malformed for deep linking.

func (*GoogleAppIndexingDeepLinkErrorManifestRule) Meta

type GoogleAppIndexingWarningManifestRule

type GoogleAppIndexingWarningManifestRule struct {
	ManifestBase
	AndroidRule
}

GoogleAppIndexingWarningManifestRule detects apps that lack any deep link support. If no activity in the manifest declares a VIEW intent filter with an http or https data scheme, the app cannot be indexed by Google Search.

func (*GoogleAppIndexingWarningManifestRule) Meta

type GradleBase

type GradleBase struct{}

GradleBase is an empty marker type embedded by Gradle rule implementations. The rule registry source records AndroidDependencies() metadata on api.Rule.AndroidDeps.

func (GradleBase) AndroidDependencies

func (GradleBase) AndroidDependencies() AndroidDataDependency

type GradleBuildContainsTodoRule

type GradleBuildContainsTodoRule struct {
	LineBase
	BaseRule
}

GradleBuildContainsTodoRule flags TODO line comments in build.gradle(.kts) scripts so release-affecting build work does not linger unnoticed.

func (*GradleBuildContainsTodoRule) Confidence

func (r *GradleBuildContainsTodoRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Release-engineering rule. Detection scans module metadata and Gradle files for configuration drift and plugin hygiene; matches are project-structure-sensitive. Classified per roadmap/17.

func (*GradleBuildContainsTodoRule) Meta

type GradleDeprecatedRule

type GradleDeprecatedRule struct {
	GradleBase
	AndroidRule
}

GradleDeprecatedRule detects deprecated Gradle configuration names that have been replaced in modern Gradle (e.g. `compile` -> `implementation`).

func (*GradleDeprecatedRule) Confidence

func (r *GradleDeprecatedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*GradleDeprecatedRule) Meta

type GradleGetterRule

type GradleGetterRule struct {
	GradleBase
	AndroidRule
}

GradleGetterRule detects deprecated Groovy-style DSL property setters in Gradle Kotlin DSL files. For example, `compileSdkVersion 30` should be `compileSdk = 30` in .kts files.

func (*GradleGetterRule) Confidence

func (r *GradleGetterRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*GradleGetterRule) Meta

type GradleIdeErrorRule

type GradleIdeErrorRule struct {
	GradleBase
	AndroidRule
}

GradleIdeErrorRule detects Gradle IDE error patterns, such as using the legacy `apply plugin:` syntax in .kts files instead of the `plugins { }` block.

func (*GradleIdeErrorRule) Confidence

func (r *GradleIdeErrorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*GradleIdeErrorRule) Meta

type GradleOldTargetAPIRule

type GradleOldTargetAPIRule struct {
	GradleBase
	AndroidRule
	Threshold int // minimum acceptable targetSdkVersion
}

GradleOldTargetAPIRule flags targetSdkVersion below a configurable threshold. Default threshold: 33 (Android 13).

func (*GradleOldTargetAPIRule) Confidence

func (r *GradleOldTargetAPIRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*GradleOldTargetAPIRule) Meta

type GradleOverridesManifestRule

type GradleOverridesManifestRule struct {
	ManifestBase
	AndroidRule
}

GradleOverridesManifestRule checks for minSdkVersion/targetSdkVersion declared in the manifest. These values should be specified in build.gradle instead, as Gradle overrides manifest values.

func (*GradleOverridesManifestRule) Meta

type GradleOverridesRule

type GradleOverridesRule struct {
	GradleBase
	AndroidRule
}

GradleOverridesRule flags Gradle build files that set both minSdk and targetSdk, which overrides any values in AndroidManifest.xml and is a common source of confusion.

func (*GradleOverridesRule) Confidence

func (r *GradleOverridesRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*GradleOverridesRule) Meta

type GradlePathRule

type GradlePathRule struct {
	GradleBase
	AndroidRule
}

GradlePathRule detects problematic dependency paths in Gradle build files: absolute paths in files()/fileTree() and backslashes in paths.

func (*GradlePathRule) Confidence

func (r *GradlePathRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*GradlePathRule) Meta

func (r *GradlePathRule) Meta() api.RuleDescriptor

type GradlePluginCompatibilityRule

type GradlePluginCompatibilityRule struct {
	GradleBase
	AndroidRule
}

GradlePluginCompatibilityRule checks AGP version vs Gradle version compatibility. Delegates to the scanner's lintGradleCompatibility via LintBuildGradle.

func (*GradlePluginCompatibilityRule) Confidence

func (r *GradlePluginCompatibilityRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*GradlePluginCompatibilityRule) Meta

GradlePluginCompatibilityRule is also registered as rule ID "GradleCompatible"; Meta() only represents the primary ID.

type GradleWrapperValidationActionRule

type GradleWrapperValidationActionRule struct {
	BaseRule
}

GradleWrapperValidationActionRule flags Gradle workflow steps missing wrapper validation.

func (*GradleWrapperValidationActionRule) Confidence

func (*GradleWrapperValidationActionRule) Meta

func (*GradleWrapperValidationActionRule) ModuleAwareNeeds

type GrantAllUrisRule

type GrantAllUrisRule struct {
	FlatDispatchBase
	AndroidRule
}

GrantAllUrisRule detects overly broad URI permissions.

func (*GrantAllUrisRule) Confidence

func (r *GrantAllUrisRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*GrantAllUrisRule) Meta

type GridLayoutRule

type GridLayoutRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*GridLayoutRule) Confidence

func (r *GridLayoutRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*GridLayoutRule) Meta

func (r *GridLayoutRule) Meta() api.RuleDescriptor

type GsonPolymorphicFromJSONRule

type GsonPolymorphicFromJSONRule struct {
	FlatDispatchBase
	BaseRule
}

GsonPolymorphicFromJSONRule detects Gson deserialization into Object/Any.

func (*GsonPolymorphicFromJSONRule) Confidence

func (r *GsonPolymorphicFromJSONRule) Confidence() float64

func (*GsonPolymorphicFromJSONRule) Meta

type HTTPClientNotReusedRule

type HTTPClientNotReusedRule struct {
	FlatDispatchBase
	BaseRule
}

HTTPClientNotReusedRule detects Java HttpClient.newHttpClient() in function bodies without caching.

func (*HTTPClientNotReusedRule) Confidence

func (r *HTTPClientNotReusedRule) Confidence() float64

func (*HTTPClientNotReusedRule) Meta

type HandlerLeakRule

type HandlerLeakRule struct {
	FlatDispatchBase
	AndroidRule
}

HandlerLeakRule detects non-static inner Handler classes via AST dispatch.

func (*HandlerLeakRule) Confidence

func (r *HandlerLeakRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence for structural match. With type resolver verifying Handler inheritance: 0.90+. Classified per roadmap/17.

func (*HandlerLeakRule) Meta

func (*HandlerLeakRule) NodeTypes

func (r *HandlerLeakRule) NodeTypes() []string

type HardcodedAwsAccessKeyRule

type HardcodedAwsAccessKeyRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedAwsAccessKeyRule detects string literals that look like an AWS access-key ID committed directly into source. AWS access-key IDs are exactly 20 characters long and start with a known prefix that identifies the credential type (long-term IAM user, temporary STS, role, etc.).

func (*HardcodedAwsAccessKeyRule) Confidence

func (r *HardcodedAwsAccessKeyRule) Confidence() float64

func (*HardcodedAwsAccessKeyRule) Meta

type HardcodedBearerTokenRule

type HardcodedBearerTokenRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedBearerTokenRule detects bearer authorization strings that embed a long token literal directly in source.

func (*HardcodedBearerTokenRule) Confidence

func (r *HardcodedBearerTokenRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Security rule. Detection pattern-matches known-insecure API shapes and argument literals without confirming the receiver type. Classified per roadmap/17.

func (*HardcodedBearerTokenRule) Meta

type HardcodedDateFormatRule

type HardcodedDateFormatRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedDateFormatRule detects DateTimeFormatter.ofPattern(pattern) called with a single string argument. Without an explicit Locale the formatter silently falls back to the device default, which produces locale-dependent output for what is usually meant to be a stable machine-readable timestamp. SimpleDateFormat is intentionally not handled here; SimpleDateFormatRule in the android-correctness rule set covers that constructor.

func (*HardcodedDateFormatRule) Confidence

func (r *HardcodedDateFormatRule) Confidence() float64

func (*HardcodedDateFormatRule) Meta

type HardcodedEnvironmentNameRule

type HardcodedEnvironmentNameRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedEnvironmentNameRule flags literal environment names passed into config/environment-like APIs where a build- or runtime-derived value is expected instead.

func (*HardcodedEnvironmentNameRule) Confidence

func (r *HardcodedEnvironmentNameRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Release-engineering rule. Detection scans module metadata and Gradle files for configuration drift and plugin hygiene; matches are project-structure-sensitive. Classified per roadmap/17.

func (*HardcodedEnvironmentNameRule) Meta

type HardcodedGcpServiceAccountRule

type HardcodedGcpServiceAccountRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedGcpServiceAccountRule detects embedded GCP service-account JSON and private keys committed into source files.

func (*HardcodedGcpServiceAccountRule) Confidence

func (r *HardcodedGcpServiceAccountRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Security rule. Detection pattern-matches known-insecure API shapes and argument literals without confirming the receiver type. Classified per roadmap/17.

func (*HardcodedGcpServiceAccountRule) Meta

type HardcodedHTTPURLRule

type HardcodedHTTPURLRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*HardcodedHTTPURLRule) Confidence

func (r *HardcodedHTTPURLRule) Confidence() float64

func (*HardcodedHTTPURLRule) Meta

type HardcodedJwtRule

type HardcodedJwtRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedJwtRule detects string literals that look like a structurally valid JSON Web Token (header.payload.signature, all base64url) committed directly into source. JWTs in source code typically indicate copy-pasted real tokens used for testing — they need to come from a secret store, not the repository.

func (*HardcodedJwtRule) Confidence

func (r *HardcodedJwtRule) Confidence() float64

func (*HardcodedJwtRule) Meta

type HardcodedLocalhostURLRule

type HardcodedLocalhostURLRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedLocalhostURLRule flags URL literals containing localhost or 10.0.2.2 in non-test non-debug source files.

func (*HardcodedLocalhostURLRule) Confidence

func (r *HardcodedLocalhostURLRule) Confidence() float64

Confidence: tier-1 — we dispatch on string_literal and read the literal's exact content via the AST's string_content children. A URL never crosses into a raw-string template or an interpolated expression by accident; if the literal has such an expression child, we refuse to match (we cannot prove the runtime URL is `localhost`). No line scanning, no quote gymnastics.

func (*HardcodedLocalhostURLRule) Meta

type HardcodedLogTagRule

type HardcodedLogTagRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedLogTagRule flags Log.d("ClassName", ...) where the tag matches the enclosing class name instead of using a companion TAG constant.

func (*HardcodedLogTagRule) Confidence

func (r *HardcodedLogTagRule) Confidence() float64

func (*HardcodedLogTagRule) Meta

type HardcodedNumberFormatRule

type HardcodedNumberFormatRule struct {
	FlatDispatchBase
	BaseRule
}

HardcodedNumberFormatRule detects DecimalFormat(pattern) constructors and NumberFormat.getInstance() calls without an explicit Locale. Without one, the formatter falls back to the device default locale, producing output (grouping separators, decimal symbols) that varies by device.

func (*HardcodedNumberFormatRule) Confidence

func (r *HardcodedNumberFormatRule) Confidence() float64

func (*HardcodedNumberFormatRule) Meta

type HardcodedSecretKeyRule

type HardcodedSecretKeyRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*HardcodedSecretKeyRule) Confidence

func (r *HardcodedSecretKeyRule) Confidence() float64

func (*HardcodedSecretKeyRule) Meta

type HardcodedTextRule

type HardcodedTextRule struct {
	FlatDispatchBase
	AndroidRule
}

HardcodedTextRule detects hardcoded strings that should use resources.

func (*HardcodedTextRule) Confidence

func (r *HardcodedTextRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*HardcodedTextRule) Meta

type HardcodedValuesResourceRule

type HardcodedValuesResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

HardcodedValuesResourceRule detects android:text with literal strings instead of @string/ references. Hardcoded text breaks internationalization.

func (*HardcodedValuesResourceRule) Confidence

func (r *HardcodedValuesResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android accessibility resource rule. Detection flags missing contentDescription, importantForAccessibility, and focusable attributes via structural checks. Classified per roadmap/17.

func (*HardcodedValuesResourceRule) Meta

type HasPlatformTypeRule

type HasPlatformTypeRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- HasPlatformTypeRule detects public fun/property without explicit return type. With type inference: uses ResolveNode on expression-body return expressions to determine if the inferred type comes from Java interop (platform type). When the resolver can determine a concrete Kotlin type, the finding is suppressed. ---------------------------------------------------------------------------

func (*HasPlatformTypeRule) Confidence

func (r *HasPlatformTypeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence because the rule falls back to a string-prefix heuristic on "java./javax./android./Java/Javax" when the resolver cannot determine the return type. Findings from that fallback path carry known false-positive risk on identifiers that happen to start with those prefixes but are not Java interop.

func (*HasPlatformTypeRule) Meta

type HiltEntryPointOnNonInterfaceRule

type HiltEntryPointOnNonInterfaceRule struct {
	FlatDispatchBase
	BaseRule
}

HiltEntryPointOnNonInterfaceRule detects Hilt entry points declared as a class or object instead of an interface.

func (*HiltEntryPointOnNonInterfaceRule) Confidence

func (r *HiltEntryPointOnNonInterfaceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule. Detection uses annotation and import patterns for Dagger/Hilt/Anvil; project-specific DI aliases are not followed. Classified per roadmap/17.

func (*HiltEntryPointOnNonInterfaceRule) Meta

type HiltInstallInMismatchRule

type HiltInstallInMismatchRule struct {
	FlatDispatchBase
	BaseRule
}

HiltInstallInMismatchRule detects @Module/@InstallIn classes whose `@Provides` functions are annotated with a Hilt scope that does not match the module's installed component.

func (*HiltInstallInMismatchRule) Confidence

func (r *HiltInstallInMismatchRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*HiltInstallInMismatchRule) Meta

type HiltSingletonWithActivityDepRule

type HiltSingletonWithActivityDepRule struct {
	FlatDispatchBase
	BaseRule
}

HiltSingletonWithActivityDepRule detects @Singleton classes whose constructor takes an Activity-, Fragment-, View-, or LifecycleOwner-scoped parameter, which is a scope mismatch.

func (*HiltSingletonWithActivityDepRule) Confidence

func (r *HiltSingletonWithActivityDepRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*HiltSingletonWithActivityDepRule) Meta

type IconColorsRule

type IconColorsRule struct {
	IconResourceBase
	AndroidRule
}

IconColorsRule checks notification and action bar icon color constraints.

func (*IconColorsRule) Confidence

func (r *IconColorsRule) Confidence() float64

func (*IconColorsRule) Meta

func (r *IconColorsRule) Meta() api.RuleDescriptor

type IconDensitiesRule

type IconDensitiesRule struct {
	IconResourceBase
	AndroidRule
}

IconDensitiesRule checks for missing density variants.

func (*IconDensitiesRule) Confidence

func (r *IconDensitiesRule) Confidence() float64

func (*IconDensitiesRule) Meta

type IconDipSizeRule

type IconDipSizeRule struct {
	IconResourceBase
	AndroidRule
}

IconDipSizeRule checks that icon dimensions match expected DPI ratios.

func (*IconDipSizeRule) Confidence

func (r *IconDipSizeRule) Confidence() float64

func (*IconDipSizeRule) Meta

type IconDuplicatesConfigRule

type IconDuplicatesConfigRule struct {
	IconResourceBase
	AndroidRule
}

IconDuplicatesConfigRule detects identical icons across different configuration folders.

func (*IconDuplicatesConfigRule) Confidence

func (r *IconDuplicatesConfigRule) Confidence() float64

func (*IconDuplicatesConfigRule) Meta

type IconDuplicatesRule

type IconDuplicatesRule struct {
	IconResourceBase
	AndroidRule
}

IconDuplicatesRule detects identical images across densities.

func (*IconDuplicatesRule) Confidence

func (r *IconDuplicatesRule) Confidence() float64

func (*IconDuplicatesRule) Meta

type IconExpectedSizeRule

type IconExpectedSizeRule struct {
	IconResourceBase
	AndroidRule
}

IconExpectedSizeRule checks that launcher icons have expected sizes.

func (*IconExpectedSizeRule) Confidence

func (r *IconExpectedSizeRule) Confidence() float64

func (*IconExpectedSizeRule) Meta

type IconExtensionRule

type IconExtensionRule struct {
	IconResourceBase
	AndroidRule
}

IconExtensionRule detects icon files whose extension does not match the contents.

func (*IconExtensionRule) Confidence

func (r *IconExtensionRule) Confidence() float64

func (*IconExtensionRule) Meta

type IconLauncherShapeRule

type IconLauncherShapeRule struct {
	IconResourceBase
	AndroidRule
}

IconLauncherShapeRule checks launcher icon shape transparency.

func (*IconLauncherShapeRule) Confidence

func (r *IconLauncherShapeRule) Confidence() float64

func (*IconLauncherShapeRule) Meta

type IconLocationRule

type IconLocationRule struct {
	IconResourceBase
	AndroidRule
}

IconLocationRule detects bitmap icons placed in density-independent drawable folders.

func (*IconLocationRule) Confidence

func (r *IconLocationRule) Confidence() float64

func (*IconLocationRule) Meta

type IconMissingDensityFolderRule

type IconMissingDensityFolderRule struct {
	IconResourceBase
	AndroidRule
}

IconMissingDensityFolderRule detects missing density folders.

func (*IconMissingDensityFolderRule) Confidence

func (r *IconMissingDensityFolderRule) Confidence() float64

func (*IconMissingDensityFolderRule) Meta

type IconMixedNinePatchRule

type IconMixedNinePatchRule struct {
	IconResourceBase
	AndroidRule
}

IconMixedNinePatchRule detects PNG and 9-patch files with the same resource name.

func (*IconMixedNinePatchRule) Confidence

func (r *IconMixedNinePatchRule) Confidence() float64

func (*IconMixedNinePatchRule) Meta

type IconNoDpiRule

type IconNoDpiRule struct {
	IconResourceBase
	AndroidRule
}

IconNoDpiRule detects icons in both drawable-nodpi and a density-specific folder.

func (*IconNoDpiRule) Confidence

func (r *IconNoDpiRule) Confidence() float64

func (*IconNoDpiRule) Meta

func (r *IconNoDpiRule) Meta() api.RuleDescriptor

type IconResourceBase

type IconResourceBase struct{}

IconResourceBase provides the AndroidDepIcons declaration shared by every icon rule. The dispatcher supplies an IconIndex to these rules.

func (IconResourceBase) AndroidDependencies

func (IconResourceBase) AndroidDependencies() AndroidDataDependency

type IconXMLAndPngRule

type IconXMLAndPngRule struct {
	IconResourceBase
	AndroidRule
}

IconXMLAndPngRule detects drawable XML and bitmap files with the same resource name.

func (*IconXMLAndPngRule) Confidence

func (r *IconXMLAndPngRule) Confidence() float64

func (*IconXMLAndPngRule) Meta

type IgnoredReturnValueRule

type IgnoredReturnValueRule struct {
	FlatDispatchBase
	BaseRule
	RestrictToConfig             bool
	ReturnValueAnnotations       []string
	IgnoreReturnValueAnnotations []string
	ReturnValueTypes             []string
	IgnoreFunctionCall           []string
}

--------------------------------------------------------------------------- IgnoredReturnValueRule detects call expressions whose non-Unit return value is discarded. Uses type inference to resolve return types and tree-sitter parent-node analysis to determine if the result is used (assigned, returned, passed as argument). Falls back to regex when resolver is unavailable. ---------------------------------------------------------------------------

func (*IgnoredReturnValueRule) Confidence

func (r *IgnoredReturnValueRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence because this rule needs type inference to resolve the return type of the call target. When the resolver is unavailable it falls back to name-based heuristics against ReturnValueTypes/IgnoreFunctionCall lists, which can miss custom wrapper APIs or fire on look-alike names.

func (*IgnoredReturnValueRule) Meta

type IllegalResourceRefResourceRule

type IllegalResourceRefResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

IllegalResourceRefResourceRule detects malformed resource references in XML attributes. Valid references must match @[+][type/]name or @android:type/name.

func (*IllegalResourceRefResourceRule) Confidence

func (r *IllegalResourceRefResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*IllegalResourceRefResourceRule) Meta

type ImageLoadedAtFullSizeInListRule

type ImageLoadedAtFullSizeInListRule struct {
	FlatDispatchBase
	BaseRule
}

ImageLoadedAtFullSizeInListRule detects Glide/Coil image loading without size constraints in list item contexts.

func (*ImageLoadedAtFullSizeInListRule) Confidence

func (r *ImageLoadedAtFullSizeInListRule) Confidence() float64

func (*ImageLoadedAtFullSizeInListRule) Meta

type ImageLoaderNoMemoryCacheRule

type ImageLoaderNoMemoryCacheRule struct {
	FlatDispatchBase
	BaseRule
}

ImageLoaderNoMemoryCacheRule detects image loaders configured to skip the memory cache.

func (*ImageLoaderNoMemoryCacheRule) Confidence

func (r *ImageLoaderNoMemoryCacheRule) Confidence() float64

func (*ImageLoaderNoMemoryCacheRule) Meta

type ImplicitDefaultLocaleRule

type ImplicitDefaultLocaleRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- ImplicitDefaultLocaleRule detects locale-sensitive String methods called without an explicit Locale argument. Covers case-conversion methods (lowercase, uppercase, capitalize, decapitalize) and String.format / ".format". Uses tree-sitter dispatch on call_expression for structural accuracy. ---------------------------------------------------------------------------

func (*ImplicitDefaultLocaleRule) Confidence

func (r *ImplicitDefaultLocaleRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence because the rule matches on method names (toLowerCase/toUpperCase/capitalize/ decapitalize, String.format) without type resolution. Any user- defined non-String method with one of those names will produce a false positive. Accuracy improves when a type resolver is wired in but the current implementation is structural-only.

func (*ImplicitDefaultLocaleRule) Meta

type ImplicitPendingIntentRule

type ImplicitPendingIntentRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ImplicitPendingIntentRule) Confidence

func (r *ImplicitPendingIntentRule) Confidence() float64

func (*ImplicitPendingIntentRule) Meta

type ImplicitUnitReturnTypeRule

type ImplicitUnitReturnTypeRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- ImplicitUnitReturnTypeRule detects block-body functions without explicit Unit return type. ---------------------------------------------------------------------------

func (*ImplicitUnitReturnTypeRule) Confidence

func (r *ImplicitUnitReturnTypeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence because this rule fires on block-body function_declarations lacking an explicit return type. That includes @Composable functions, which conventionally omit ': Unit' — a convention mismatch rather than a bug, but one that produces noise on Compose codebases. Medium confidence keeps it off default-strict gates without taking it out of the rule set.

func (*ImplicitUnitReturnTypeRule) IsFixable

func (r *ImplicitUnitReturnTypeRule) IsFixable() bool

func (*ImplicitUnitReturnTypeRule) Meta

type ImpliedQuantityResourceRule

type ImpliedQuantityResourceRule struct {
	ValuesPluralsResourceBase
	AndroidRule
}

ImpliedQuantityResourceRule detects plural "one" quantities whose value does not contain a %d format specifier. When "one" is selected, the actual number may not be 1 (e.g., 21, 31 in some locales), so the value should include %d to display the correct number.

func (*ImpliedQuantityResourceRule) Confidence

func (r *ImpliedQuantityResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*ImpliedQuantityResourceRule) Meta

type InOrMmUsageResourceRule

type InOrMmUsageResourceRule struct {
	ResourceBase
	AndroidRule
}

InOrMmUsageResourceRule detects dimension values using `in` (inches) or `mm` (millimeters) units. These units map to exact physical sizes and do not scale well across different screen sizes and densities.

func (InOrMmUsageResourceRule) AndroidDependencies

func (InOrMmUsageResourceRule) AndroidDependencies() AndroidDataDependency

func (*InOrMmUsageResourceRule) Confidence

func (r *InOrMmUsageResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*InOrMmUsageResourceRule) Meta

type IncludeLayoutParamResourceRule

type IncludeLayoutParamResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

IncludeLayoutParamResourceRule detects <include> elements that specify layout_width or layout_height. These attributes are ignored on <include> unless the included layout has a <merge> root.

func (*IncludeLayoutParamResourceRule) Confidence

func (r *IncludeLayoutParamResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*IncludeLayoutParamResourceRule) Meta

type InconsistentArraysResourceRule

type InconsistentArraysResourceRule struct {
	ValuesArraysResourceBase
	AndroidRule
}

InconsistentArraysResourceRule detects string-array resources with zero items. Arrays with zero items are likely incomplete or missing translations.

func (*InconsistentArraysResourceRule) Confidence

func (r *InconsistentArraysResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*InconsistentArraysResourceRule) Meta

type InconsistentLayoutResourceRule

type InconsistentLayoutResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

InconsistentLayoutResourceRule detects layout XML files that differ significantly across configuration qualifiers (e.g. layout/ vs layout-land/). Different root view types, significantly different view counts (>50%), or different root child counts are flagged.

func (*InconsistentLayoutResourceRule) Confidence

func (r *InconsistentLayoutResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*InconsistentLayoutResourceRule) Meta

type InefficientWeightResourceRule

type InefficientWeightResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

InefficientWeightResourceRule detects a LinearLayout that uses layout_weight on children but does not specify an android:orientation attribute. Without orientation, the default is horizontal, which can be unintentional.

func (*InefficientWeightResourceRule) Confidence

func (r *InefficientWeightResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*InefficientWeightResourceRule) Meta

type InjectDispatcherRule

type InjectDispatcherRule struct {
	FlatDispatchBase
	BaseRule
	DispatcherNames []string
}

InjectDispatcherRule detects hardcoded Dispatchers.IO/Default/Unconfined in call expressions.

func (*InjectDispatcherRule) Confidence

func (r *InjectDispatcherRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule flags any call that passes Dispatchers.IO/Default/Unconfined as an argument, with exclusions for idiomatic dispatcher hosts (e.g. withContext, flowOn), `Main` (which can't be injected), and object/@JvmStatic enclosing functions. It does NOT understand DI annotations — a class that already accepts `@Inject` would still trip the rule if the test-injected default happens to be a Dispatchers constant. Medium confidence reflects the DI-awareness gap noted in roadmap/17.

func (*InjectDispatcherRule) Meta

type InjectOnAbstractClassRule

type InjectOnAbstractClassRule struct {
	FlatDispatchBase
	BaseRule
}

InjectOnAbstractClassRule detects @Inject primary constructors on abstract classes. Dagger cannot instantiate an abstract class, so the binding is unreachable.

func (*InjectOnAbstractClassRule) Confidence

func (r *InjectOnAbstractClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*InjectOnAbstractClassRule) Meta

type InlinedAPIRule

type InlinedAPIRule struct {
	FlatDispatchBase
	AndroidRule
}

InlinedAPIRule detects usage of constants inlined from newer APIs using a static lookup table. Guarded blocks are skipped.

func (*InlinedAPIRule) Confidence

func (r *InlinedAPIRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*InlinedAPIRule) Meta

func (r *InlinedAPIRule) Meta() api.RuleDescriptor

type InnerclassSeparatorRule

type InnerclassSeparatorRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*InnerclassSeparatorRule) Confidence

func (r *InnerclassSeparatorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*InnerclassSeparatorRule) Meta

type InsecureBaseConfigurationManifestRule

type InsecureBaseConfigurationManifestRule struct {
	ManifestBase
	AndroidRule
}

InsecureBaseConfigurationManifestRule detects missing networkSecurityConfig on the application element when targeting API 28+. Without a network security config, the app uses the platform default which may allow cleartext traffic.

func (*InsecureBaseConfigurationManifestRule) Meta

type InsecureTrustManagerRule

type InsecureTrustManagerRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*InsecureTrustManagerRule) Confidence

func (r *InsecureTrustManagerRule) Confidence() float64

func (*InsecureTrustManagerRule) Meta

type InstanceOfCheckForExceptionRule

type InstanceOfCheckForExceptionRule struct {
	FlatDispatchBase
	BaseRule
}

InstanceOfCheckForExceptionRule detects `is SomeException` inside catch blocks.

func (*InstanceOfCheckForExceptionRule) Confidence

func (r *InstanceOfCheckForExceptionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*InstanceOfCheckForExceptionRule) Meta

type InstantiatableRule

type InstantiatableRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*InstantiatableRule) Confidence

func (r *InstantiatableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*InstantiatableRule) Meta

type IntentFilterExportRequiredRule

type IntentFilterExportRequiredRule struct {
	ManifestBase
	AndroidRule
}

IntentFilterExportRequiredRule checks that components with intent-filters explicitly declare android:exported. Starting with API 31, this is required. This is stricter than MissingExportedFlag: it flags all component types.

func (*IntentFilterExportRequiredRule) Meta

type IntoMapDuplicateKeyRule

type IntoMapDuplicateKeyRule struct {
	FlatDispatchBase
	BaseRule
}

IntoMapDuplicateKeyRule detects two or more @IntoMap @Provides/@Binds functions in the same enclosing module/component that declare the same key literal. Duplicate map keys create conflicting contributions.

func (*IntoMapDuplicateKeyRule) Confidence

func (r *IntoMapDuplicateKeyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*IntoMapDuplicateKeyRule) Meta

type IntoMapMissingKeyRule

type IntoMapMissingKeyRule struct {
	FlatDispatchBase
	BaseRule
}

IntoMapMissingKeyRule detects @IntoMap @Provides/@Binds functions that lack a `@*Key(...)` annotation. Without a key annotation, Dagger fails at code generation.

func (*IntoMapMissingKeyRule) Confidence

func (r *IntoMapMissingKeyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*IntoMapMissingKeyRule) Meta

type IntoSetDuplicateTypeRule

type IntoSetDuplicateTypeRule struct {
	FlatDispatchBase
	BaseRule
}

IntoSetDuplicateTypeRule detects two or more @IntoSet @Provides functions in the same enclosing module/component that return the same concrete impl expression — Dagger's set dedupes by value, so contributions are lost.

func (*IntoSetDuplicateTypeRule) Confidence

func (r *IntoSetDuplicateTypeRule) Confidence() float64

Confidence reports a tier-3 (lower) base confidence. Detection compares the final returned-expression callee text; aliases and indirection are not followed.

func (*IntoSetDuplicateTypeRule) Meta

type IntoSetOnNonSetReturnRule

type IntoSetOnNonSetReturnRule struct {
	FlatDispatchBase
	BaseRule
}

IntoSetOnNonSetReturnRule detects @IntoSet @Provides functions whose return type is a collection wrapper (List/Set/Map/Collection/Iterable/Array). Dagger multibindings collect by return type, so wrapping the contribution in a collection drops the intended elements.

func (*IntoSetOnNonSetReturnRule) Confidence

func (r *IntoSetOnNonSetReturnRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*IntoSetOnNonSetReturnRule) Meta

type InvalidIDResourceRule

type InvalidIDResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

InvalidIDResourceRule detects malformed android:id values. Valid IDs match @+id/name or @id/name where name contains only [a-zA-Z0-9_].

func (*InvalidIDResourceRule) Confidence

func (r *InvalidIDResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*InvalidIDResourceRule) Meta

type InvalidPackageDeclarationRule

type InvalidPackageDeclarationRule struct {
	FlatDispatchBase
	BaseRule
	RootPackage              string
	RequireRootInDeclaration bool
}

InvalidPackageDeclarationRule checks that the package declaration matches the directory structure.

func (*InvalidPackageDeclarationRule) Confidence

func (r *InvalidPackageDeclarationRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*InvalidPackageDeclarationRule) Meta

type InvalidRangeRule

type InvalidRangeRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- InvalidRangeRule detects backwards ranges like 10..1. ---------------------------------------------------------------------------

func (*InvalidRangeRule) Confidence

func (r *InvalidRangeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs lifecycle rule. Detection matches framework lifecycle hook shapes by name and annotation; project-specific wrappers can escape detection. Classified per roadmap/17.

func (*InvalidRangeRule) IsFixable

func (r *InvalidRangeRule) IsFixable() bool

func (*InvalidRangeRule) Meta

type InvalidResourceFolderResourceRule

type InvalidResourceFolderResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

InvalidResourceFolderResourceRule checks layout file paths for invalid resource folder prefixes. Valid prefixes are: layout, drawable, mipmap, values, raw, xml, anim, animator, color, menu, font, navigation, transition.

func (*InvalidResourceFolderResourceRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*InvalidResourceFolderResourceRule) Meta

type InvalidUsesTagAttributeManifestRule

type InvalidUsesTagAttributeManifestRule struct {
	ManifestBase
	AndroidRule
}

InvalidUsesTagAttributeManifestRule detects <uses-feature> elements where android:required is set to a value other than "true" or "false".

func (*InvalidUsesTagAttributeManifestRule) Meta

type IteratorHasNextCallsNextMethodRule

type IteratorHasNextCallsNextMethodRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- IteratorHasNextCallsNextMethodRule detects hasNext() calling next(). ---------------------------------------------------------------------------

func (*IteratorHasNextCallsNextMethodRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Potential-bugs lifecycle rule. Detection matches framework lifecycle hook shapes by name and annotation; project-specific wrappers can escape detection. Classified per roadmap/17.

func (*IteratorHasNextCallsNextMethodRule) Meta

type IteratorNotThrowingNoSuchElementExceptionRule

type IteratorNotThrowingNoSuchElementExceptionRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- IteratorNotThrowingNoSuchElementExceptionRule detects next() without throw. ---------------------------------------------------------------------------

func (*IteratorNotThrowingNoSuchElementExceptionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Potential-bugs lifecycle rule. Detection matches framework lifecycle hook shapes by name and annotation; project-specific wrappers can escape detection. Classified per roadmap/17.

func (*IteratorNotThrowingNoSuchElementExceptionRule) Meta

type JacksonDefaultTypingRule

type JacksonDefaultTypingRule struct {
	FlatDispatchBase
	BaseRule
}

JacksonDefaultTypingRule detects Jackson default typing APIs that can enable polymorphic deserialization gadget attacks.

func (*JacksonDefaultTypingRule) Confidence

func (r *JacksonDefaultTypingRule) Confidence() float64

func (*JacksonDefaultTypingRule) Meta

type JavaObjectInputStreamRule

type JavaObjectInputStreamRule struct {
	FlatDispatchBase
	BaseRule
}

JavaObjectInputStreamRule detects direct Java serialization input streams in production source.

func (*JavaObjectInputStreamRule) Confidence

func (r *JavaObjectInputStreamRule) Confidence() float64

func (*JavaObjectInputStreamRule) Meta

type JavaSupportMatrix

type JavaSupportMatrix struct {
	Version         int
	ClosureCriteria []string
	Infrastructure  map[string]api.LanguageSupport
	RuleSetDefaults map[string]api.LanguageSupport
	Rules           map[string]api.LanguageSupport
}

JavaSupportMatrix is the source-of-truth Java source support classification. It covers analyzer infrastructure, ruleset defaults, and per-rule overrides.

func JavaSupportReadiness

func JavaSupportReadiness() JavaSupportMatrix

JavaSupportReadiness returns the checked-in Java source support matrix.

type JdbcPreparedStatementNotClosedRule

type JdbcPreparedStatementNotClosedRule struct {
	FlatDispatchBase
	BaseRule
}

JdbcPreparedStatementNotClosedRule detects JDBC prepared statements assigned to local properties without a later .use {} or .close() in the same scope.

func (*JdbcPreparedStatementNotClosedRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names and function calls without confirming the declared type is a Room DAO or entity. Classified per roadmap/17.

func (*JdbcPreparedStatementNotClosedRule) Meta

type JdbcResultSetLeakedFromFunctionRule

type JdbcResultSetLeakedFromFunctionRule struct {
	FlatDispatchBase
	BaseRule
}

JdbcResultSetLeakedFromFunctionRule detects functions whose declared return type is java.sql.ResultSet. Returning a ResultSet to a caller almost always leaks the underlying cursor because the caller forgets to close it.

func (*JdbcResultSetLeakedFromFunctionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names and function calls without confirming the declared type is a Room DAO or entity. Classified per roadmap/17.

func (*JdbcResultSetLeakedFromFunctionRule) Meta

type JdbcStatementExecuteRule

type JdbcStatementExecuteRule struct {
	FlatDispatchBase
	BaseRule
}

JdbcStatementExecuteRule detects java.sql.Statement execution calls whose SQL argument is computed from non-static data.

func (*JdbcStatementExecuteRule) Confidence

func (r *JdbcStatementExecuteRule) Confidence() float64

func (*JdbcStatementExecuteRule) Meta

type JvmTargetMismatchRule

type JvmTargetMismatchRule struct {
	GradleBase
	BaseRule
}

JvmTargetMismatchRule flags Kotlin and Java JVM target settings that disagree.

func (*JvmTargetMismatchRule) Confidence

func (r *JvmTargetMismatchRule) Confidence() float64

func (*JvmTargetMismatchRule) Meta

type KDocReferencesNonPublicPropertyRule

type KDocReferencesNonPublicPropertyRule struct {
	FlatDispatchBase
	BaseRule
}

KDocReferencesNonPublicPropertyRule finds KDoc [ref] to non-public properties.

func (*KDocReferencesNonPublicPropertyRule) Confidence

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*KDocReferencesNonPublicPropertyRule) Meta

type KdocLinkValidationRule

type KdocLinkValidationRule struct {
	BaseRule
}

KdocLinkValidationRule detects KDoc bracket links that do not resolve to source symbols.

func (*KdocLinkValidationRule) Confidence

func (r *KdocLinkValidationRule) Confidence() float64

Confidence reflects source-index lookup with conservative external-library skips.

func (*KdocLinkValidationRule) Meta

type KotlinVersionMismatchAcrossModulesRule

type KotlinVersionMismatchAcrossModulesRule struct {
	BaseRule
}

KotlinVersionMismatchAcrossModulesRule flags modules with divergent Kotlin JVM targets.

func (*KotlinVersionMismatchAcrossModulesRule) Confidence

func (*KotlinVersionMismatchAcrossModulesRule) Meta

func (*KotlinVersionMismatchAcrossModulesRule) ModuleAwareNeeds

type LabelForResourceRule

type LabelForResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

LabelForResourceRule detects EditText views without a corresponding labelFor from a sibling view, which is needed for accessibility.

func (*LabelForResourceRule) Confidence

func (r *LabelForResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android accessibility resource rule. Detection flags missing contentDescription, importantForAccessibility, and focusable attributes via structural checks. Classified per roadmap/17.

func (*LabelForResourceRule) Meta

type LabeledExpressionRule

type LabeledExpressionRule struct {
	FlatDispatchBase
	BaseRule
	IgnoredLabels []string
}

LabeledExpressionRule detects return@label, break@label, continue@label.

func (*LabeledExpressionRule) Confidence

func (r *LabeledExpressionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*LabeledExpressionRule) Meta

type LambdaParameterNamingRule

type LambdaParameterNamingRule struct {
	FlatDispatchBase
	BaseRule
	Pattern *regexp.Regexp
}

LambdaParameterNamingRule checks lambda parameter names.

func (*LambdaParameterNamingRule) Confidence

func (r *LambdaParameterNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*LambdaParameterNamingRule) Meta

type LargeClassRule

type LargeClassRule struct {
	FlatDispatchBase
	BaseRule
	AllowedLines int
}

LargeClassRule detects classes exceeding a line count.

func (*LargeClassRule) Confidence

func (r *LargeClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*LargeClassRule) Meta

func (r *LargeClassRule) Meta() api.RuleDescriptor

type LateinitUsageRule

type LateinitUsageRule struct {
	FlatDispatchBase
	BaseRule
	IgnoreOnClassesPattern *regexp.Regexp
}

--------------------------------------------------------------------------- LateinitUsageRule detects lateinit var. ---------------------------------------------------------------------------

func (*LateinitUsageRule) Confidence

func (r *LateinitUsageRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs lifecycle rule. Detection matches framework lifecycle hook shapes by name and annotation; project-specific wrappers can escape detection. Classified per roadmap/17.

func (*LateinitUsageRule) Meta

type LaunchWithoutCoroutineExceptionHandlerRule

type LaunchWithoutCoroutineExceptionHandlerRule struct {
	FlatDispatchBase
	BaseRule
}

LaunchWithoutCoroutineExceptionHandlerRule detects launch{} with throw but no handler.

func (*LaunchWithoutCoroutineExceptionHandlerRule) Confidence

func (*LaunchWithoutCoroutineExceptionHandlerRule) Meta

type LayerDependencyViolationRule

type LayerDependencyViolationRule struct {
	BaseRule
	LayerConfig *arch.LayerConfig
}

LayerDependencyViolationRule enforces a configurable layer dependency matrix (e.g. ui may depend on domain, domain may depend on data). Inactive by default: requires project-specific layer config.

func (*LayerDependencyViolationRule) Confidence

func (r *LayerDependencyViolationRule) Confidence() float64

Confidence is 0.95 — given a well-defined layer matrix, the check is a deterministic graph walk. False positives only occur from misconfigured layer definitions, not from algorithm imprecision.

func (*LayerDependencyViolationRule) Meta

Meta returns the descriptor for LayerDependencyViolationRule. No per-option config — the rule pulls its layer matrix out of the whole config tree inside CustomApply.

func (*LayerDependencyViolationRule) ModuleAwareNeeds

func (r *LayerDependencyViolationRule) ModuleAwareNeeds() ModuleAwareNeeds

type LayoutAutofillHintMismatchRule

type LayoutAutofillHintMismatchRule struct {
	LayoutResourceBase
	AndroidRule
}

func (*LayoutAutofillHintMismatchRule) Confidence

func (r *LayoutAutofillHintMismatchRule) Confidence() float64

func (*LayoutAutofillHintMismatchRule) Meta

type LayoutClickableWithoutMinSizeRule

type LayoutClickableWithoutMinSizeRule struct {
	LayoutResourceBase
	AndroidRule
}

func (*LayoutClickableWithoutMinSizeRule) Confidence

func (*LayoutClickableWithoutMinSizeRule) Meta

type LayoutEditTextMissingImportanceRule

type LayoutEditTextMissingImportanceRule struct {
	LayoutResourceBase
	AndroidRule
}

func (*LayoutEditTextMissingImportanceRule) Confidence

func (*LayoutEditTextMissingImportanceRule) Meta

type LayoutImportantForAccessibilityNoRule

type LayoutImportantForAccessibilityNoRule struct {
	LayoutResourceBase
	AndroidRule
}

func (*LayoutImportantForAccessibilityNoRule) Confidence

func (*LayoutImportantForAccessibilityNoRule) Meta

type LayoutInflationRule

type LayoutInflationRule struct {
	FlatDispatchBase
	LayoutResourceBase
	AndroidRule
}

func (*LayoutInflationRule) Confidence

func (r *LayoutInflationRule) Confidence() float64

Confidence reports a high-confidence AST/resource-backed check. The remaining uncertainty is limited to intentional no-parent contexts that do not have a precise type signal in tree-sitter-only analysis.

func (*LayoutInflationRule) Meta

func (*LayoutInflationRule) NodeTypes

func (r *LayoutInflationRule) NodeTypes() []string

type LayoutMinTouchTargetInButtonRowRule

type LayoutMinTouchTargetInButtonRowRule struct {
	LayoutResourceBase
	AndroidRule
}

func (*LayoutMinTouchTargetInButtonRowRule) Confidence

func (*LayoutMinTouchTargetInButtonRowRule) Meta

type LayoutResourceBase

type LayoutResourceBase struct{ ResourceBase }

func (LayoutResourceBase) AndroidDependencies

func (LayoutResourceBase) AndroidDependencies() AndroidDataDependency

type LazyColumnInsideColumnRule

type LazyColumnInsideColumnRule struct {
	FlatDispatchBase
	BaseRule
}

LazyColumnInsideColumnRule detects LazyColumn nested inside a Column with verticalScroll modifier.

func (*LazyColumnInsideColumnRule) Confidence

func (r *LazyColumnInsideColumnRule) Confidence() float64

func (*LazyColumnInsideColumnRule) Meta

type LazyInsteadOfDirectRule

type LazyInsteadOfDirectRule struct {
	FlatDispatchBase
	BaseRule
}

LazyInsteadOfDirectRule detects constructor parameters typed Lazy<T> whose `.get()` is called unconditionally at class-init time. Direct injection is cheaper because the value is already eagerly required.

func (*LazyInsteadOfDirectRule) Confidence

func (r *LazyInsteadOfDirectRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*LazyInsteadOfDirectRule) Meta

type LgplStaticLinkingInApkRule

type LgplStaticLinkingInApkRule struct {
	GradleBase
	BaseRule
}

LgplStaticLinkingInApkRule flags `com.android.application` modules that statically link a known-LGPL artifact. Static linking creates redistribution ambiguity under the LGPL; isolating the dependency to a `com.android.dynamic-feature` module delivered separately avoids the issue.

func (*LgplStaticLinkingInApkRule) Confidence

func (r *LgplStaticLinkingInApkRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Licensing rule keyed on an embedded LGPL artifact registry; coverage depends on registry breadth.

type LibraryCodeMustSpecifyReturnTypeRule

type LibraryCodeMustSpecifyReturnTypeRule struct {
	FlatDispatchBase
	BaseRule
}

LibraryCodeMustSpecifyReturnTypeRule detects public functions and properties without explicit return types. In libraries, implicit return types are part of the public API and can change unexpectedly.

func (*LibraryCodeMustSpecifyReturnTypeRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Library-hygiene rule. Detection matches on known library package names and API shapes without confirming the actual import target. Classified per roadmap/17.

func (*LibraryCodeMustSpecifyReturnTypeRule) Meta

type LibraryCustomViewRule

type LibraryCustomViewRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*LibraryCustomViewRule) Confidence

func (r *LibraryCustomViewRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*LibraryCustomViewRule) Meta

type LibraryEntitiesShouldNotBePublicRule

type LibraryEntitiesShouldNotBePublicRule struct {
	FlatDispatchBase
	BaseRule
}

LibraryEntitiesShouldNotBePublicRule detects public top-level classes, functions, and properties that could be internal in library code.

func (*LibraryEntitiesShouldNotBePublicRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Library-hygiene rule. Detection matches on known library package names and API shapes without confirming the actual import target. Classified per roadmap/17.

func (*LibraryEntitiesShouldNotBePublicRule) Meta

type LineBase

type LineBase = base.LineBase

type LocalSuppressRule

type LocalSuppressRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*LocalSuppressRule) Confidence

func (r *LocalSuppressRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*LocalSuppressRule) Meta

type LocaleConfigMissingRule

type LocaleConfigMissingRule struct {
	ManifestBase
	AndroidRule
}

LocaleConfigMissingRule detects manifests that declare android:localeConfig but do not ship the referenced XML resource alongside the main manifest.

func (*LocaleConfigMissingRule) Meta

type LocaleConfigStaleResourceRule

type LocaleConfigStaleResourceRule struct {
	ValuesResourceBase
	AndroidRule
}

LocaleConfigStaleResourceRule detects locale-config resources whose declared locales no longer match the explicit values-XX folders present under res/.

func (*LocaleConfigStaleResourceRule) Confidence

func (r *LocaleConfigStaleResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*LocaleConfigStaleResourceRule) Meta

type LocaleDefaultForCurrencyRule

type LocaleDefaultForCurrencyRule struct {
	FlatDispatchBase
	BaseRule
}

LocaleDefaultForCurrencyRule detects Currency.getInstance(Locale.getDefault()) inside money-related classes. Currency in these flows should come from the business data being formatted, not from the user's device locale.

func (*LocaleDefaultForCurrencyRule) Confidence

func (r *LocaleDefaultForCurrencyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs rule. Detection uses structural AST patterns and optional resolver-backed type checks; fallback path is heuristic. Classified per roadmap/17.

func (*LocaleDefaultForCurrencyRule) Meta

type LocaleFolderRule

type LocaleFolderRule struct {
	LineBase
	AndroidRule
}

func (*LocaleFolderRule) Confidence

func (r *LocaleFolderRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*LocaleFolderRule) Meta

type LocaleGetDefaultForFormattingRule

type LocaleGetDefaultForFormattingRule struct {
	FlatDispatchBase
	BaseRule
}

LocaleGetDefaultForFormattingRule flags `Locale.getDefault()` passed to a formatter used in a persistence or network IO context (a `DateTimeFormatter` ISO/RFC constant). For machine-readable output the locale should be `Locale.ROOT` or `Locale.US` so the bytes do not vary by device locale.

func (*LocaleGetDefaultForFormattingRule) Confidence

type LocationBackgroundWithoutRationaleRule

type LocationBackgroundWithoutRationaleRule struct {
	FlatDispatchBase
	BaseRule
}

LocationBackgroundWithoutRationaleRule flags requestPermissions calls for ACCESS_BACKGROUND_LOCATION when the file has no shouldShowRequestPermissionRationale call.

func (*LocationBackgroundWithoutRationaleRule) Confidence

func (*LocationBackgroundWithoutRationaleRule) Meta

type LogDetectorRule

type LogDetectorRule struct {
	FlatDispatchBase
	AndroidRule
}

LogDetectorRule detects unconditional logging calls.

func (*LogDetectorRule) Confidence

func (r *LogDetectorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*LogDetectorRule) Meta

type LogLevelGuardMissingRule

type LogLevelGuardMissingRule struct {
	FlatDispatchBase
	BaseRule
}

LogLevelGuardMissingRule detects debug/trace logger calls whose message template interpolates a call expression, causing eager work when the level is disabled unless the call is guarded.

func (*LogLevelGuardMissingRule) Confidence

func (r *LogLevelGuardMissingRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Observability rule. Detection pattern-matches logging/metrics API call shapes without confirming the receiver type. Classified per roadmap/17.

func (*LogLevelGuardMissingRule) Meta

type LogOfSharedPreferenceReadRule

type LogOfSharedPreferenceReadRule struct {
	FlatDispatchBase
	BaseRule
}

LogOfSharedPreferenceReadRule flags logger calls whose argument directly passes a SharedPreferences getString/getInt value with a sensitive key.

func (*LogOfSharedPreferenceReadRule) Confidence

func (r *LogOfSharedPreferenceReadRule) Confidence() float64

func (*LogOfSharedPreferenceReadRule) Meta

type LogPiiRule

type LogPiiRule struct {
	FlatDispatchBase
	BaseRule
	PiiNamePattern *regexp.Regexp
}

LogPiiRule detects logger calls that interpolate or concatenate sensitive variable names into log messages.

func (*LogPiiRule) Confidence

func (r *LogPiiRule) Confidence() float64

func (*LogPiiRule) Meta

func (r *LogPiiRule) Meta() api.RuleDescriptor

type LogTagLengthRule

type LogTagLengthRule struct {
	FlatDispatchBase
	AndroidRule
}

LogTagLengthRule flags Log.x() calls where the tag string literal exceeds 23 characters (the maximum enforced by older Android versions).

func (*LogTagLengthRule) Confidence

func (r *LogTagLengthRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*LogTagLengthRule) Meta

type LogTagMismatchRule

type LogTagMismatchRule struct {
	FlatDispatchBase
	AndroidRule
}

LogTagMismatchRule flags Log.x(TAG, ...) calls where the TAG companion constant value doesn't match the enclosing class name.

func (*LogTagMismatchRule) Confidence

func (r *LogTagMismatchRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*LogTagMismatchRule) Meta

type LogWithoutCorrelationIDRule

type LogWithoutCorrelationIDRule struct {
	FlatDispatchBase
	BaseRule
}

LogWithoutCorrelationIDRule detects logger calls inside coroutine builders whose context does not include MDCContext().

func (*LogWithoutCorrelationIDRule) Confidence

func (r *LogWithoutCorrelationIDRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Observability rule. Detection pattern-matches logging/metrics API call shapes without confirming the receiver type. Classified per roadmap/17.

func (*LogWithoutCorrelationIDRule) Meta

type LoggerInterpolatedMessageRule

type LoggerInterpolatedMessageRule struct {
	FlatDispatchBase
	BaseRule
}

LoggerInterpolatedMessageRule detects SLF4J/Logback/log4j-style logger calls whose message argument is a Kotlin string template with interpolations. Parameterized logging (`logger.info("user {} logged in", id)`) is preferred because the template caches and the call skips argument evaluation when the level is disabled. Timber is excluded — its API is designed around Kotlin string interpolation. The lazy lambda form (`logger.info { "user $id logged in" }`) is also excluded because it defers evaluation until the level is enabled.

func (*LoggerInterpolatedMessageRule) Confidence

func (r *LoggerInterpolatedMessageRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Observability rule. Detection pattern-matches logging/metrics API call shapes without confirming the receiver type. Classified per roadmap/17.

func (*LoggerInterpolatedMessageRule) Meta

type LoggerStringConcatRule

type LoggerStringConcatRule struct {
	FlatDispatchBase
	BaseRule
}

LoggerStringConcatRule detects SLF4J/Logback/log4j-style logger calls whose message argument is built with `+` string concatenation. Like string interpolation, this evaluates the concatenation eagerly even when the level is disabled. The fix is the same parameterized form (`logger.info("value={}", value)`).

func (*LoggerStringConcatRule) Confidence

func (r *LoggerStringConcatRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Detection pattern-matches logger call shapes without confirming the receiver type.

func (*LoggerStringConcatRule) Meta

type LoggerWithoutLoggerFieldRule

type LoggerWithoutLoggerFieldRule struct {
	FlatDispatchBase
	BaseRule
}

LoggerWithoutLoggerFieldRule detects LoggerFactory.getLogger(...) calls inside function bodies where a per-call logger instance would be created.

func (*LoggerWithoutLoggerFieldRule) Confidence

func (r *LoggerWithoutLoggerFieldRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Observability rule. Detection pattern-matches logging/metrics API call shapes without confirming the receiver type. Classified per roadmap/17.

func (*LoggerWithoutLoggerFieldRule) Meta

type LongMethodRule

type LongMethodRule struct {
	FlatDispatchBase
	BaseRule
	AllowedLines int
}

LongMethodRule detects functions exceeding a line count.

func (*LongMethodRule) Confidence

func (r *LongMethodRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*LongMethodRule) Description

func (*LongMethodRule) Description() string

Description implements DescriptionProvider.

func (*LongMethodRule) Meta

func (r *LongMethodRule) Meta() api.RuleDescriptor

type LongParameterListRule

type LongParameterListRule struct {
	FlatDispatchBase
	BaseRule
	AllowedFunctionParameters    int
	AllowedConstructorParameters int
	IgnoreDefaultParameters      bool     // if true, parameters with defaults are not counted
	IgnoreDataClasses            bool     // if true, data class constructors are skipped
	IgnoreAnnotatedParameter     []string // annotations that exclude a parameter from counting
}

LongParameterListRule detects functions/constructors with too many parameters.

func (*LongParameterListRule) Confidence

func (r *LongParameterListRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*LongParameterListRule) Meta

type LoopWithTooManyJumpStatementsRule

type LoopWithTooManyJumpStatementsRule struct {
	FlatDispatchBase
	BaseRule
	MaxJumps int
}

LoopWithTooManyJumpStatementsRule limits break/continue in loops.

func (*LoopWithTooManyJumpStatementsRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection is pattern-based and the preferred form is a style preference. Classified per roadmap/17.

func (*LoopWithTooManyJumpStatementsRule) Meta

type MagicNumberRule

type MagicNumberRule struct {
	FlatDispatchBase
	BaseRule
	IgnoreAnnotated                          []string
	CustomPreviewWildcard                    bool
	CustomPreviewPrefixes                    []string
	IgnorePropertyDeclaration                bool     // if true, skip numbers in val/var declarations
	IgnoreComposeUnits                       bool     // if true, skip numbers followed by .dp, .sp, .px, .em
	IgnoreColorLiterals                      bool     // if true, skip hex color literals (0xAARRGGBB)
	IgnoreNumbers                            []string // numbers to ignore (default: -1, 0, 1, 2)
	IgnoreHashCodeFunction                   bool     // if true, skip numbers in hashCode()
	IgnoreConstantDeclaration                bool     // if true, skip numbers in const val
	IgnoreAnnotation                         bool     // if true, skip numbers inside annotations
	IgnoreNamedArgument                      bool     // if true, skip numbers in named arguments
	IgnoreEnums                              bool     // if true, skip numbers in enum entries
	IgnoreRanges                             bool     // if true, skip numbers in ranges (1..10)
	IgnoreCompanionObjectPropertyDeclaration bool
	IgnoreExtensionFunctions                 bool
	IgnoreLocalVariableDeclaration           bool
	// contains filtered or unexported fields
}

MagicNumberRule detects literal numbers in code.

func (*MagicNumberRule) Confidence

func (r *MagicNumberRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. MagicNumber is structurally accurate but highly context-dependent: whether a literal is "magic" depends on call context, domain, and convention, and several of its heuristics (IgnoreComposeUnits, IgnoreRanges, IgnoreCompanionObjectPropertyDeclaration) are best-effort. Medium confidence lets strict pipelines filter it out while keeping it available for default-severity scans.

func (*MagicNumberRule) Meta

type MainDispatcherInLibraryCodeRule

type MainDispatcherInLibraryCodeRule struct {
	BaseRule
}

MainDispatcherInLibraryCodeRule detects Dispatchers.Main in library modules without kotlinx-coroutines-android dependency.

func (*MainDispatcherInLibraryCodeRule) Confidence

func (r *MainDispatcherInLibraryCodeRule) Confidence() float64

func (*MainDispatcherInLibraryCodeRule) IsFixable

func (r *MainDispatcherInLibraryCodeRule) IsFixable() bool

func (*MainDispatcherInLibraryCodeRule) Meta

func (*MainDispatcherInLibraryCodeRule) ModuleAwareNeeds

func (r *MainDispatcherInLibraryCodeRule) ModuleAwareNeeds() ModuleAwareNeeds

type MandatoryBracesLoopsRule

type MandatoryBracesLoopsRule struct {
	FlatDispatchBase
	BaseRule
}

MandatoryBracesLoopsRule requires braces in for/while/do-while loops.

func (*MandatoryBracesLoopsRule) Confidence

func (r *MandatoryBracesLoopsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/braces rule. Detection checks AST shape for if/when/else brace presence; the preferred form is a style preference. Classified per roadmap/17.

func (*MandatoryBracesLoopsRule) IsFixable

func (r *MandatoryBracesLoopsRule) IsFixable() bool

Style2 fixable rules (batch 4)

func (*MandatoryBracesLoopsRule) Meta

type MangledCRLFRule

type MangledCRLFRule struct {
	LineBase
	AndroidRule
}

func (*MangledCRLFRule) Confidence

func (r *MangledCRLFRule) Confidence() float64

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 -- mixed line endings is a literal substring check on the file bytes. Deterministic with no heuristic path.

func (*MangledCRLFRule) Meta

type Manifest

type Manifest = manifest.Manifest

type ManifestApplication

type ManifestApplication = manifest.Application

type ManifestBase

type ManifestBase struct{}

ManifestBase is an empty marker type embedded by manifest rule implementations. The rule registry source records AndroidDependencies() metadata on api.Rule.AndroidDeps.

func (ManifestBase) AndroidDependencies

func (ManifestBase) AndroidDependencies() AndroidDataDependency

func (ManifestBase) Confidence

func (ManifestBase) Confidence() float64

Confidence reports a tier-2 (medium) base confidence for manifest rules. Detection flags exported components, insecure flags, and overly broad permissions via manifest attribute checks; flavors or manifest merging can occasionally change the effective app manifest. Override per rule when the detection is purely structural.

type ManifestComponent

type ManifestComponent = manifest.Component

type ManifestElement

type ManifestElement = manifest.Element

type ManifestMetaData

type ManifestMetaData = manifest.MetaData

type ManifestOrderManifestRule

type ManifestOrderManifestRule struct {
	ManifestBase
	AndroidRule
}

ManifestOrderManifestRule detects <application> appearing before <uses-permission> or <uses-sdk> in the manifest. Conventional ordering places <uses-permission> and <uses-sdk> before <application>.

func (*ManifestOrderManifestRule) Meta

type ManifestTypoRule

type ManifestTypoRule struct {
	ManifestBase
	AndroidRule
}

ManifestTypoRule detects common typos in manifest element names.

func (*ManifestTypoRule) Meta

type ManifestUsesFeature

type ManifestUsesFeature = manifest.UsesFeature

type MapGetWithNotNullAssertionRule

type MapGetWithNotNullAssertionRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- MapGetWithNotNullAssertionRule detects map[key]!!. ---------------------------------------------------------------------------

func (*MapGetWithNotNullAssertionRule) Confidence

func (r *MapGetWithNotNullAssertionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — tree-sitter structural check backed by resolver/source type confirmation that the receiver is Map-like. Classified per roadmap/17.

func (*MapGetWithNotNullAssertionRule) IsFixable

func (r *MapGetWithNotNullAssertionRule) IsFixable() bool

func (*MapGetWithNotNullAssertionRule) Meta

type MatchingDeclarationNameRule

type MatchingDeclarationNameRule struct {
	FlatDispatchBase
	BaseRule
	MustBeFirst          bool
	MultiplatformTargets []string
}

MatchingDeclarationNameRule checks that a file with a single non-private top-level class or object has a filename matching that declaration's name. Only KtClassOrObject declarations (class, interface, object, enum) are counted; private classes are excluded; top-level functions, properties and typealiases do not count toward the "single declaration" check. A typealias whose name matches the filename suppresses the finding (allows Foo.kt with typealias Foo = FooImpl + class FooImpl).

func (*MatchingDeclarationNameRule) Confidence

func (r *MatchingDeclarationNameRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*MatchingDeclarationNameRule) Meta

type MavenLocalRule

type MavenLocalRule struct {
	GradleBase
	AndroidRule
}

MavenLocalRule flags usage of mavenLocal() repository, which can cause unreproducible builds.

func (*MavenLocalRule) Confidence

func (r *MavenLocalRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*MavenLocalRule) Meta

func (r *MavenLocalRule) Meta() api.RuleDescriptor

type MaxChainedCallsOnSameLineRule

type MaxChainedCallsOnSameLineRule struct {
	LineBase
	BaseRule
	MaxCalls int
}

MaxChainedCallsOnSameLineRule limits chained method calls on a single line.

func (*MaxChainedCallsOnSameLineRule) Confidence

func (r *MaxChainedCallsOnSameLineRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/formatting rule. Detection is pattern or regex based on line text; deterministic byte checks have been promoted to tier-1 separately. Classified per roadmap/17.

func (*MaxChainedCallsOnSameLineRule) Meta

type MaxLineLengthRule

type MaxLineLengthRule struct {
	LineBase
	BaseRule
	Max                      int
	ExcludePackageStatements bool
	ExcludeImportStatements  bool
	ExcludeCommentStatements bool
	ExcludeRawStrings        bool
}

MaxLineLengthRule detects lines exceeding the configured max.

func (*MaxLineLengthRule) Confidence

func (r *MaxLineLengthRule) Confidence() float64

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 — line length is a deterministic measurement, and the rule already skips test files and gradle scripts where long lines are conventional.

func (*MaxLineLengthRule) IsFixable

func (r *MaxLineLengthRule) IsFixable() bool

func (*MaxLineLengthRule) Meta

type MayBeConstantRule

type MayBeConstantRule struct {
	FlatDispatchBase
	BaseRule
}

MayBeConstantRule detects top-level vals that could be const.

func (*MayBeConstantRule) Confidence

func (r *MayBeConstantRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Initializers are checked structurally and same-file constant references are resolved when they share the same owner, but the finding remains a style preference.

func (*MayBeConstantRule) IsFixable

func (r *MayBeConstantRule) IsFixable() bool

func (*MayBeConstantRule) Meta

type MdcAcrossCoroutineBoundaryRule

type MdcAcrossCoroutineBoundaryRule struct {
	FlatDispatchBase
	BaseRule
}

MdcAcrossCoroutineBoundaryRule detects an `MDC.put(...)` followed by a coroutine builder (`launch`/`async`/`withContext`) in the same statement scope whose context argument does not include `MDCContext()`. MDC values do not propagate to a coroutine running on a different dispatcher unless the caller installs `MDCContext` in the coroutine context.

func (*MdcAcrossCoroutineBoundaryRule) Confidence

func (r *MdcAcrossCoroutineBoundaryRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Observability rule. Detection pattern-matches logging/metrics API call shapes without confirming the receiver type. Classified per roadmap/17.

func (*MdcAcrossCoroutineBoundaryRule) Meta

type MdcPutNoRemoveRule

type MdcPutNoRemoveRule struct {
	FlatDispatchBase
	BaseRule
}

MdcPutNoRemoveRule detects MDC.put("key", value) calls inside a function body where the same function does not contain a matching MDC.remove("key") or MDC.clear(). MDC values otherwise leak across requests when the thread is reused. The MDCCloseable form (MDC.putCloseable("key", value).use { ... }) is naturally excluded because its call name is putCloseable, not put.

func (*MdcPutNoRemoveRule) Confidence

func (r *MdcPutNoRemoveRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Observability rule. Detection pattern-matches logging/metrics API call shapes without confirming the receiver type. Classified per roadmap/17.

func (*MdcPutNoRemoveRule) Meta

type MemberNameEqualsClassNameRule

type MemberNameEqualsClassNameRule struct {
	FlatDispatchBase
	BaseRule
	IgnoreOverridden bool
}

MemberNameEqualsClassNameRule flags members whose name equals the containing class name.

func (*MemberNameEqualsClassNameRule) Confidence

func (r *MemberNameEqualsClassNameRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*MemberNameEqualsClassNameRule) Meta

type MergeConflictMarkerLeftoverRule

type MergeConflictMarkerLeftoverRule struct {
	LineBase
	BaseRule
}

MergeConflictMarkerLeftoverRule flags unresolved merge conflict markers.

func (*MergeConflictMarkerLeftoverRule) Confidence

func (r *MergeConflictMarkerLeftoverRule) Confidence() float64

func (*MergeConflictMarkerLeftoverRule) Meta

type MergeRootFrameResourceRule

type MergeRootFrameResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

MergeRootFrameResourceRule detects a root FrameLayout that could be replaced with a <merge> tag to reduce one level of nesting when the layout is included in another layout.

func (*MergeRootFrameResourceRule) Confidence

func (r *MergeRootFrameResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*MergeRootFrameResourceRule) Meta

type MethodOverloadingRule

type MethodOverloadingRule struct {
	FlatDispatchBase
	BaseRule
	AllowedOverloads int
}

MethodOverloadingRule detects too many overloads of the same method name.

func (*MethodOverloadingRule) Confidence

func (r *MethodOverloadingRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*MethodOverloadingRule) Meta

type MetricCounterNotMonotonicRule

type MetricCounterNotMonotonicRule struct {
	FlatDispatchBase
	BaseRule
}

MetricCounterNotMonotonicRule detects negative counter increments.

func (*MetricCounterNotMonotonicRule) Confidence

func (r *MetricCounterNotMonotonicRule) Confidence() float64

func (*MetricCounterNotMonotonicRule) Meta

type MetricNameMissingUnitRule

type MetricNameMissingUnitRule struct {
	FlatDispatchBase
	BaseRule

	Suffixes []string
}

MetricNameMissingUnitRule detects metric names without a unit suffix.

func (*MetricNameMissingUnitRule) Confidence

func (r *MetricNameMissingUnitRule) Confidence() float64

func (*MetricNameMissingUnitRule) Meta

type MetricTagHighCardinalityRule

type MetricTagHighCardinalityRule struct {
	FlatDispatchBase
	BaseRule

	Keys []string
}

MetricTagHighCardinalityRule detects metric constructor tag keys that would create one time series per user/session/request.

func (*MetricTagHighCardinalityRule) Confidence

func (r *MetricTagHighCardinalityRule) Confidence() float64

func (*MetricTagHighCardinalityRule) Meta

type MetricTimerOutsideBlockRule

type MetricTimerOutsideBlockRule struct {
	FlatDispatchBase
	BaseRule
}

MetricTimerOutsideBlockRule detects timer.record blocks that don't wrap any call work, making the timing measurement effectively meaningless.

func (*MetricTimerOutsideBlockRule) Confidence

func (r *MetricTimerOutsideBlockRule) Confidence() float64

func (*MetricTimerOutsideBlockRule) Meta

type MetroFactoryDeclarationShapeRule

type MetroFactoryDeclarationShapeRule struct {
	FlatDispatchBase
	BaseRule
}

MetroFactoryDeclarationShapeRule detects Metro factory annotations on concrete or sealed declarations. Metro factory implementations are generated.

func (*MetroFactoryDeclarationShapeRule) Confidence

func (r *MetroFactoryDeclarationShapeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*MetroFactoryDeclarationShapeRule) Meta

type MinSdkTooLowRule

type MinSdkTooLowRule struct {
	GradleBase
	AndroidRule
	Threshold int // minimum acceptable minSdkVersion
}

MinSdkTooLowRule flags minSdkVersion below a configurable threshold. Default threshold: 21 (Android 5.0 Lollipop).

func (*MinSdkTooLowRule) Confidence

func (r *MinSdkTooLowRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*MinSdkTooLowRule) Meta

type MipmapLauncherRule

type MipmapLauncherRule struct {
	ManifestBase
	AndroidRule
}

MipmapLauncherRule checks that the launcher icon references @mipmap/ not @drawable/. Launcher icons should use mipmap resources for proper density handling.

func (*MipmapLauncherRule) Meta

type MissingApplicationIconRule

type MissingApplicationIconRule struct {
	ManifestBase
	AndroidRule
}

MissingApplicationIconRule checks that the <application> element has android:icon set.

func (*MissingApplicationIconRule) Meta

type MissingContentDescriptionResourceRule

type MissingContentDescriptionResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

MissingContentDescriptionResourceRule detects ImageView (and ImageButton) elements that lack a contentDescription attribute, which is required for screen readers.

func (*MissingContentDescriptionResourceRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Android accessibility resource rule. Detection flags missing contentDescription, importantForAccessibility, and focusable attributes via structural checks. Classified per roadmap/17.

func (*MissingContentDescriptionResourceRule) Meta

type MissingExportedFlagRule

type MissingExportedFlagRule struct {
	ManifestBase
	AndroidRule
}

MissingExportedFlagRule checks for components with intent-filters that do not explicitly declare android:exported. Starting with API 31 (Android 12), android:exported is required for any component that declares intent-filters.

func (*MissingExportedFlagRule) Meta

type MissingGradleChecksumsRule

type MissingGradleChecksumsRule struct {
	BaseRule
}

MissingGradleChecksumsRule flags dependency locking declarations without a sibling lockfile.

func (*MissingGradleChecksumsRule) Confidence

func (r *MissingGradleChecksumsRule) Confidence() float64

func (*MissingGradleChecksumsRule) Meta

func (*MissingGradleChecksumsRule) ModuleAwareNeeds

func (r *MissingGradleChecksumsRule) ModuleAwareNeeds() ModuleAwareNeeds

type MissingIDResourceRule

type MissingIDResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

MissingIDResourceRule detects <fragment> and <include> tags that lack an android:id attribute. Fragment and include views should have IDs so they can be properly restored during configuration changes.

func (*MissingIDResourceRule) Confidence

func (r *MissingIDResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*MissingIDResourceRule) Meta

type MissingJvmSuppressWildcardsRule

type MissingJvmSuppressWildcardsRule struct {
	FlatDispatchBase
	BaseRule
}

MissingJvmSuppressWildcardsRule detects @Provides/@Binds functions returning Set<T> or Map<K, V> without @JvmSuppressWildcards on the value type. Without the annotation, the Kotlin compiler emits Set<? extends T> in JVM signatures and Dagger fails to find matching multibindings.

func (*MissingJvmSuppressWildcardsRule) Confidence

func (r *MissingJvmSuppressWildcardsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*MissingJvmSuppressWildcardsRule) Meta

type MissingLeanbackLauncherManifestRule

type MissingLeanbackLauncherManifestRule struct {
	ManifestBase
	AndroidRule
}

MissingLeanbackLauncherManifestRule detects apps that declare the android.software.leanback feature but have no activity with a LEANBACK_LAUNCHER category in its intent filter. Without a leanback launcher activity, the app won't appear on Android TV.

func (*MissingLeanbackLauncherManifestRule) Meta

type MissingLeanbackSupportManifestRule

type MissingLeanbackSupportManifestRule struct {
	ManifestBase
	AndroidRule
}

MissingLeanbackSupportManifestRule detects apps that declare the android.software.leanback feature but do not opt out of the touchscreen requirement. TV apps must declare <uses-feature android:name="android.hardware.touchscreen" android:required="false" /> because TV devices do not have touchscreens.

func (*MissingLeanbackSupportManifestRule) Meta

type MissingPackageDeclarationRule

type MissingPackageDeclarationRule struct {
	LineBase
	BaseRule
}

--------------------------------------------------------------------------- MissingPackageDeclarationRule detects Kotlin/Java source files without package statements. ---------------------------------------------------------------------------

func (*MissingPackageDeclarationRule) Confidence

func (r *MissingPackageDeclarationRule) Confidence() float64

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 — the check walks the first non-blank, non-comment line and verifies it starts with "package ". Deterministic with no heuristic path.

func (*MissingPackageDeclarationRule) IsFixable

func (r *MissingPackageDeclarationRule) IsFixable() bool

Potential-bugs fixable rules (batch 4) MissingPackageDeclaration: Check() derives a package fix from the file path via derivePackageFix, which only works when the path contains a recognizable source root (src/main/kotlin/...). Files outside those roots — including the fixture files themselves — get no Fix. Advertised as not-fixable because the fix isn't stable across inputs.

func (*MissingPackageDeclarationRule) Meta

type MissingPermissionRule

type MissingPermissionRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*MissingPermissionRule) Confidence

func (r *MissingPermissionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule requires a structural or resolved Android API anchor and a same-permission guard proof, but can still run with source-level type evidence when KAA call targets are unavailable.

func (*MissingPermissionRule) Meta

func (*MissingPermissionRule) NodeTypes

func (r *MissingPermissionRule) NodeTypes() []string

type MissingPrefixResourceRule

type MissingPrefixResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

MissingPrefixResourceRule detects layout attributes that are missing the android: namespace prefix. Attributes like "text" or "id" without "android:" are silently ignored at runtime.

func (*MissingPrefixResourceRule) Confidence

func (r *MissingPrefixResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*MissingPrefixResourceRule) Meta

type MissingQuantityResourceRule

type MissingQuantityResourceRule struct {
	ValuesPluralsResourceBase
	AndroidRule
}

MissingQuantityResourceRule detects plural resources that are missing the required "other" quantity. In English (and all locales), "other" is always required.

func (*MissingQuantityResourceRule) Confidence

func (r *MissingQuantityResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*MissingQuantityResourceRule) Meta

type MissingRegisteredManifestRule

type MissingRegisteredManifestRule struct {
	ManifestBase
	AndroidRule
}

MissingRegisteredManifestRule detects component class names in the manifest that look invalid — empty name, name starting with a digit, or other obviously malformed class references.

func (*MissingRegisteredManifestRule) Meta

type MissingReturnRule added in v0.2.0

type MissingReturnRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- MissingReturnRule — flags block-bodied functions with a non-Unit/non-Nothing declared return type whose body cannot guarantee a returned value on every path. Mimics kotlinc's NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY diagnostic using AST + the same termination helpers UnreachableCode uses.

Rule scope is intentionally narrow:

  • block-bodied functions only (`{ ... }`); expression bodies (`= expr`) always return their expression value
  • functions with an explicit declared return type only; the implicit Unit case is silent
  • return type "Unit"/"Nothing" (and the kotlin.X qualified forms) is skipped because Unit doesn't need a return and Nothing-returning functions can't return normally
  • abstract / interface / expect / external functions have no body and are skipped

---------------------------------------------------------------------------

func (*MissingReturnRule) Confidence added in v0.2.0

func (r *MissingReturnRule) Confidence() float64

type MissingSpdxIdentifierRule

type MissingSpdxIdentifierRule struct {
	LineBase
	BaseRule
	RequiredPrefix string
}

MissingSpdxIdentifierRule flags header comments that omit a SPDX license identifier. This first pass only validates that a leading comment includes the standard SPDX marker; config-driven license matching can layer on later.

func (*MissingSpdxIdentifierRule) Confidence

func (r *MissingSpdxIdentifierRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Licensing rule. Detection scans file headers and manifests for license markers via regex; custom or non-English headers can produce false negatives. Classified per roadmap/17.

type MissingSuperCallRule

type MissingSuperCallRule struct {
	FlatDispatchBase
	BaseRule
	MustInvokeSuperAnnotations []string
}

--------------------------------------------------------------------------- MissingSuperCallRule detects high-confidence framework lifecycle overrides that omit their required super call. ---------------------------------------------------------------------------

func (*MissingSuperCallRule) Confidence

func (r *MissingSuperCallRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs lifecycle rule. Detection matches framework lifecycle hook shapes by name and annotation; project-specific wrappers can escape detection. Classified per roadmap/17.

func (*MissingSuperCallRule) IsFixable

func (r *MissingSuperCallRule) IsFixable() bool

func (*MissingSuperCallRule) Meta

type MissingUseCallRule

type MissingUseCallRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- MissingUseCallRule detects Closeable/AutoCloseable resource creation without .use {} block. Operates on call_expression AST nodes. ---------------------------------------------------------------------------

func (*MissingUseCallRule) Confidence

func (r *MissingUseCallRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs lifecycle rule. Detection matches framework lifecycle hook shapes by name and annotation; project-specific wrappers can escape detection. Classified per roadmap/17.

func (*MissingUseCallRule) Meta

type MissingVersionManifestRule

type MissingVersionManifestRule struct {
	ManifestBase
	AndroidRule
}

MissingVersionManifestRule detects missing android:versionCode or android:versionName on the <manifest> element.

func (*MissingVersionManifestRule) Meta

type MixedAssertionLibrariesRule

type MixedAssertionLibrariesRule struct {
	LineBase
	BaseRule
}

MixedAssertionLibrariesRule detects files that import both JUnit Assert and Truth APIs in the import header.

func (*MixedAssertionLibrariesRule) Confidence

func (r *MixedAssertionLibrariesRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Testing-quality rule. Detection matches on assertion framework call shapes (JUnit, Truth, Kotest, MockK) by name — cross-library identifier collisions can produce false positives. Classified per roadmap/17.

func (*MixedAssertionLibrariesRule) Meta

type MockLocationManifestRule

type MockLocationManifestRule struct {
	ManifestBase
	AndroidRule
}

MockLocationManifestRule detects the ACCESS_MOCK_LOCATION permission in a non-debug manifest. This permission should only be present in debug builds.

func (*MockLocationManifestRule) Meta

type MockWithoutVerifyRule

type MockWithoutVerifyRule struct {
	FlatDispatchBase
	BaseRule
}

func (*MockWithoutVerifyRule) Confidence

func (r *MockWithoutVerifyRule) Confidence() float64

func (*MockWithoutVerifyRule) Meta

type ModifierOrderRule

type ModifierOrderRule struct {
	FlatDispatchBase
	BaseRule
}

ModifierOrderRule detects modifiers not in the recommended order.

func (*ModifierOrderRule) Confidence

func (r *ModifierOrderRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection is pattern-based and the preferred form is a style preference. Classified per roadmap/17.

func (*ModifierOrderRule) IsFixable

func (r *ModifierOrderRule) IsFixable() bool

func (*ModifierOrderRule) Meta

type ModuleAwareNeeds

type ModuleAwareNeeds struct {
	NeedsFiles        bool
	NeedsDependencies bool
	NeedsIndex        bool
}

ModuleAwareNeeds describes which module-analysis inputs a rule requires. Graph-only rules can avoid the heavier dependency parsing and per-module symbol index build that dead-code style rules need.

func CollectModuleAwareNeeds

func CollectModuleAwareNeeds(activeRules []*api.Rule) ModuleAwareNeeds

CollectModuleAwareNeeds collapses the requirements for module-aware rules so callers can avoid paying for unused analysis stages.

type ModuleAwareRuleTuning

type ModuleAwareRuleTuning interface {
	ModuleAwareNeeds() ModuleAwareNeeds
}

ModuleAwareRuleTuning is an optional interface that lets module-aware rules declare whether they actually need module files, dependency metadata, or per-module symbol indexes. Rules that do not implement it default to the most conservative behavior.

type ModuleDeadCodeRule

type ModuleDeadCodeRule struct {
	BaseRule
}

ModuleDeadCodeRule detects dead code with module-boundary awareness. It categorises symbols as truly-dead, could-be-internal, or dead-internal.

func (*ModuleDeadCodeRule) Confidence

func (r *ModuleDeadCodeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence for the same reason as DeadCode: the module-aware analyzer relies on index evidence and local generated-use filters rather than a full compiler model.

func (*ModuleDeadCodeRule) IsFixable

func (r *ModuleDeadCodeRule) IsFixable() bool

func (*ModuleDeadCodeRule) ModuleAwareNeeds

func (r *ModuleDeadCodeRule) ModuleAwareNeeds() ModuleAwareNeeds

type ModuleDependencyCycleRule

type ModuleDependencyCycleRule struct {
	BaseRule
}

ModuleDependencyCycleRule reports cross-module cycles in the Gradle dependency graph derived from every build.gradle(.kts). Active by default: module-level cycles indicate a serious architectural problem that blocks clean module boundaries and incremental builds.

func (*ModuleDependencyCycleRule) Confidence

func (r *ModuleDependencyCycleRule) Confidence() float64

Confidence is 0.95 — Tarjan SCC on the parsed module graph is deterministic and precise. A reported cycle is a real cycle.

func (*ModuleDependencyCycleRule) ModuleAwareNeeds

func (r *ModuleDependencyCycleRule) ModuleAwareNeeds() ModuleAwareNeeds

type ModuleTemplateConformanceRule

type ModuleTemplateConformanceRule struct {
	BaseRule
	Template config.ModuleTemplateConfig
}

ModuleTemplateConformanceRule checks that configured feature root modules declare the required child modules and Gradle plugins.

func (*ModuleTemplateConformanceRule) Confidence

func (r *ModuleTemplateConformanceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule relies on Gradle settings/build-script text parsing rather than a full Gradle model.

func (*ModuleTemplateConformanceRule) Meta

func (*ModuleTemplateConformanceRule) ModuleAwareNeeds

func (r *ModuleTemplateConformanceRule) ModuleAwareNeeds() ModuleAwareNeeds

type ModuleWithNonStaticProvidesRule

type ModuleWithNonStaticProvidesRule struct {
	FlatDispatchBase
	BaseRule
}

ModuleWithNonStaticProvidesRule detects @Module abstract class declarations that mix @Binds (abstract instance methods) with @Provides functions at the top level. The @Provides functions belong in a companion object so Dagger can call them statically.

func (*ModuleWithNonStaticProvidesRule) Confidence

func (r *ModuleWithNonStaticProvidesRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*ModuleWithNonStaticProvidesRule) Meta

type MultilineLambdaItParameterRule

type MultilineLambdaItParameterRule struct {
	FlatDispatchBase
	BaseRule
}

MultilineLambdaItParameterRule detects 'it' in multiline lambdas.

func (*MultilineLambdaItParameterRule) Confidence

func (r *MultilineLambdaItParameterRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection uses structural pattern matching on expressions; the suggested rewrite's readability is a style call. Classified per roadmap/17.

func (*MultilineLambdaItParameterRule) IsFixable

func (r *MultilineLambdaItParameterRule) IsFixable() bool

func (*MultilineLambdaItParameterRule) Meta

type MultilineRawStringIndentationRule

type MultilineRawStringIndentationRule struct {
	FlatDispatchBase
	BaseRule
	IndentSize      int
	TrimmingMethods []string
}

MultilineRawStringIndentationRule checks raw string indentation.

func (*MultilineRawStringIndentationRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection uses structural pattern matching on expressions; the suggested rewrite's readability is a style call. Classified per roadmap/17.

func (*MultilineRawStringIndentationRule) Meta

type MultipleUsesSdkManifestRule

type MultipleUsesSdkManifestRule struct {
	ManifestBase
	AndroidRule
}

MultipleUsesSdkManifestRule detects more than one <uses-sdk> element in the manifest. Only one <uses-sdk> element is allowed.

func (*MultipleUsesSdkManifestRule) Meta

type MutableStateInObjectRule

type MutableStateInObjectRule struct {
	FlatDispatchBase
	BaseRule
}

MutableStateInObjectRule detects var properties inside object declarations.

func (*MutableStateInObjectRule) Confidence

func (r *MutableStateInObjectRule) Confidence() float64

func (*MutableStateInObjectRule) Meta

type NamedArgumentsRule

type NamedArgumentsRule struct {
	FlatDispatchBase
	BaseRule
	AllowedArguments int
}

NamedArgumentsRule detects function calls with too many unnamed arguments.

func (*NamedArgumentsRule) Confidence

func (r *NamedArgumentsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*NamedArgumentsRule) Meta

type NamespaceTypoResourceRule

type NamespaceTypoResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

NamespaceTypoResourceRule detects misspelled Android namespace URIs. The correct namespace is "http://schemas.android.com/apk/res/android".

func (*NamespaceTypoResourceRule) Confidence

func (r *NamespaceTypoResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*NamespaceTypoResourceRule) Meta

type NegativeMarginResourceRule

type NegativeMarginResourceRule struct {
	LayoutResourceBase
	AndroidRule
	AllowedNegativeMargins []string
}

NegativeMarginResourceRule detects negative margin values, which can cause views to overlap or be clipped unexpectedly.

func (*NegativeMarginResourceRule) Confidence

func (r *NegativeMarginResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*NegativeMarginResourceRule) Meta

type NestedBlockDepthRule

type NestedBlockDepthRule struct {
	FlatDispatchBase
	BaseRule
	AllowedDepth int
}

NestedBlockDepthRule detects excessive nesting.

func (*NestedBlockDepthRule) Confidence

func (r *NestedBlockDepthRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*NestedBlockDepthRule) Meta

type NestedClassesVisibilityRule

type NestedClassesVisibilityRule struct {
	FlatDispatchBase
	BaseRule
}

NestedClassesVisibilityRule reports nested classes/objects/interfaces that use an explicit public modifier inside an internal parent class. The public keyword is misleading because the nested class still has internal visibility.

func (*NestedClassesVisibilityRule) Confidence

func (r *NestedClassesVisibilityRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/classes rule. Detection relies on modifier and declaration structure plus (optional) resolver-backed inheritance checks; the fallback path is heuristic. Classified per roadmap/17.

func (*NestedClassesVisibilityRule) Meta

type NestedScopeFunctionsRule

type NestedScopeFunctionsRule struct {
	FlatDispatchBase
	BaseRule
	AllowedDepth int
	Functions    []string
}

NestedScopeFunctionsRule detects nested scope functions (apply, also, let, run, with).

func (*NestedScopeFunctionsRule) Confidence

func (r *NestedScopeFunctionsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*NestedScopeFunctionsRule) Meta

type NestedScrollingResourceRule

type NestedScrollingResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

NestedScrollingResourceRule detects ScrollView nested inside another ScrollView, which causes broken or unpredictable scrolling behavior.

func (*NestedScrollingResourceRule) Confidence

func (r *NestedScrollingResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*NestedScrollingResourceRule) Meta

type NestedScrollingRule

type NestedScrollingRule struct {
	FlatDispatchBase
	AndroidRule
}

NestedScrollingRule detects nested scrolling views.

func (*NestedScrollingRule) Confidence

func (r *NestedScrollingRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*NestedScrollingRule) Meta

type NestedWeightsResourceRule

type NestedWeightsResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

NestedWeightsResourceRule detects layout_weight inside a child LinearLayout that itself is inside a LinearLayout with weights. Nested weights cause exponential measure passes.

func (*NestedWeightsResourceRule) Confidence

func (r *NestedWeightsResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*NestedWeightsResourceRule) Meta

type NetworkSecurityConfigDebugOverridesRule

type NetworkSecurityConfigDebugOverridesRule struct {
	ManifestBase
	AndroidRule
}

NetworkSecurityConfigDebugOverridesRule detects main/shared network security config resources that ship debug-only trust anchors to release builds.

func (*NetworkSecurityConfigDebugOverridesRule) Confidence

func (*NetworkSecurityConfigDebugOverridesRule) Meta

type NewAPIRule

type NewAPIRule struct {
	FlatDispatchBase
	AndroidRule
}

NewAPIRule detects calls to APIs introduced after minSdk using a static lookup table of common Android APIs and their introduction levels. Lines guarded by @RequiresApi, @TargetApi, or Build.VERSION.SDK_INT checks are skipped.

func (*NewAPIRule) Confidence

func (r *NewAPIRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*NewAPIRule) Meta

func (r *NewAPIRule) Meta() api.RuleDescriptor

type NewLineAtEndOfFileRule

type NewLineAtEndOfFileRule struct {
	LineBase
	BaseRule
}

NewLineAtEndOfFileRule detects files not ending with a newline.

func (*NewLineAtEndOfFileRule) Confidence

func (r *NewLineAtEndOfFileRule) Confidence() float64

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 — presence/absence of a trailing newline is a single byte check with no room for interpretation.

func (*NewLineAtEndOfFileRule) IsFixable

func (r *NewLineAtEndOfFileRule) IsFixable() bool

func (*NewLineAtEndOfFileRule) Meta

type NewerVersionAvailableRule

type NewerVersionAvailableRule struct {
	GradleBase
	AndroidRule
	RecommendedVersions []libMinVersion
}

NewerVersionAvailableRule flags dependencies using known-outdated versions of major libraries based on a minimum recommended version table.

func (*NewerVersionAvailableRule) Confidence

func (r *NewerVersionAvailableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*NewerVersionAvailableRule) Meta

Meta returns the descriptor for NewerVersionAvailableRule.

type NfcTechWhitespaceRule

type NfcTechWhitespaceRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*NfcTechWhitespaceRule) Confidence

func (r *NfcTechWhitespaceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*NfcTechWhitespaceRule) Meta

type NoElseInWhenSealedRule added in v0.2.0

type NoElseInWhenSealedRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- NoElseInWhenSealedRule — the inverse of ElseCaseInsteadOfExhaustiveWhen. Flags `when` expressions whose subject is a sealed type or enum, that have no `else` branch, and that are missing one or more variants. Mimics kotlinc's NO_ELSE_IN_WHEN / NON_EXHAUSTIVE_WHEN_STATEMENT diagnostics for the cases the resolver can prove from source — sealed hierarchies and enums declared in the workspace.

Without a resolver the rule cannot identify variants and stays silent. Library-defined sealed types (e.g. kotlin.Result) require classpath metadata; until that lands the rule simply doesn't fire on them. ---------------------------------------------------------------------------

func (*NoElseInWhenSealedRule) Confidence added in v0.2.0

func (r *NoElseInWhenSealedRule) Confidence() float64

type NoNameShadowingRule

type NoNameShadowingRule struct {
	FlatDispatchBase
	BaseRule
}

NoNameShadowingRule flags inner declarations that shadow outer ones. NoNameShadowing behavior:

  • Skips underscore "_" names
  • Non-inner class bodies reset scope (outer names not inherited)
  • Object/companion object declarations reset scope
  • Class member function params do NOT shadow class constructor params (accessible via this.name)

func (*NoNameShadowingRule) Confidence

func (r *NoNameShadowingRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence because this rule is highly accurate per-shadow but extremely noisy on real codebases (~1,785 findings on pocket-android-app per roadmap/17). Many shadows are intentional (scoping functions, kotlinx.coroutines flow collectors, builder DSLs). Medium confidence keeps it in --min-confidence=medium pipelines but lets strict pipelines filter it out of their default gate.

func (*NoNameShadowingRule) Meta

type NoTabsRule

type NoTabsRule struct {
	LineBase
	BaseRule
	// IndentSize is the number of spaces a tab is replaced with by the
	// fix. Configurable via the `indentSize` option (or .editorconfig's
	// `indent_size` / `tab_width`). Defaults to 4.
	IndentSize int
}

NoTabsRule detects tab characters.

func (*NoTabsRule) Confidence

func (r *NoTabsRule) Confidence() float64

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 — presence of a tab character is a pure byte check with no room for interpretation.

func (*NoTabsRule) IsFixable

func (r *NoTabsRule) IsFixable() bool

func (*NoTabsRule) Meta

func (r *NoTabsRule) Meta() api.RuleDescriptor

type NonASCIIIdentifierRule

type NonASCIIIdentifierRule struct {
	FlatDispatchBase
	BaseRule
}

NonASCIIIdentifierRule flags class/function/property names containing non-ASCII characters.

func (*NonASCIIIdentifierRule) Confidence

func (r *NonASCIIIdentifierRule) Confidence() float64

func (*NonASCIIIdentifierRule) Meta

type NonBooleanPropertyPrefixedWithIsRule

type NonBooleanPropertyPrefixedWithIsRule struct {
	FlatDispatchBase
	BaseRule
}

NonBooleanPropertyPrefixedWithIsRule flags non-Boolean properties that start with "is".

func (*NonBooleanPropertyPrefixedWithIsRule) Confidence

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*NonBooleanPropertyPrefixedWithIsRule) Meta

type NonInternationalizedSmsRule

type NonInternationalizedSmsRule struct {
	FlatDispatchBase
	AndroidRule
}

NonInternationalizedSmsRule flags SmsManager.sendTextMessage() calls that may not handle internationalization of phone numbers or message encoding.

func (*NonInternationalizedSmsRule) Confidence

func (r *NonInternationalizedSmsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*NonInternationalizedSmsRule) Meta

type NotImplementedDeclarationRule

type NotImplementedDeclarationRule struct {
	FlatDispatchBase
	BaseRule
}

NotImplementedDeclarationRule detects TODO() calls.

func (*NotImplementedDeclarationRule) Confidence

func (r *NotImplementedDeclarationRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*NotImplementedDeclarationRule) Meta

type NotSiblingResourceRule

type NotSiblingResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

NotSiblingResourceRule detects RelativeLayout constraints that reference IDs not belonging to a sibling view. When layout_below, layout_above, etc. reference an @id/ that is not a direct child of the same RelativeLayout, the constraint is invalid.

func (*NotSiblingResourceRule) Confidence

func (r *NotSiblingResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android RTL resource rule. Detection flags start/end vs left/right attribute usage and bidi markers via attribute presence checks. Classified per roadmap/17.

func (*NotSiblingResourceRule) Meta

type NoticeFileOutOfDateRule

type NoticeFileOutOfDateRule struct {
	GradleBase
	BaseRule
	NoticeRequiredArtifacts []string
}

NoticeFileOutOfDateRule flags projects whose NOTICE file is missing attribution text required by one or more declared dependencies.

func (*NoticeFileOutOfDateRule) Confidence

func (r *NoticeFileOutOfDateRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Licensing rule. Detection scans a NOTICE file for artifact identifiers; custom phrasing can produce false negatives.

type NullCheckOnMutablePropertyRule

type NullCheckOnMutablePropertyRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- NullCheckOnMutablePropertyRule detects null check on var property. ---------------------------------------------------------------------------

func (*NullCheckOnMutablePropertyRule) Confidence

func (r *NullCheckOnMutablePropertyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — distinguishing val vs var requires type resolution of the receiver. Heuristic fallback uses declaration patterns. Classified per roadmap/17.

func (*NullCheckOnMutablePropertyRule) Meta

type NullableBooleanCheckRule

type NullableBooleanCheckRule struct {
	FlatDispatchBase
	BaseRule
}

NullableBooleanCheckRule detects `x == true` on Boolean?.

func (*NullableBooleanCheckRule) Confidence

func (r *NullableBooleanCheckRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection uses structural pattern matching on expressions; the suggested rewrite's readability is a style call. Classified per roadmap/17.

func (*NullableBooleanCheckRule) IsFixable

func (r *NullableBooleanCheckRule) IsFixable() bool

func (*NullableBooleanCheckRule) Meta

type NullableStructuredFieldRule

type NullableStructuredFieldRule struct {
	FlatDispatchBase
	BaseRule
}

NullableStructuredFieldRule detects addKeyValue fields that pass nullable safe-call expressions without an explicit fallback value.

func (*NullableStructuredFieldRule) Confidence

func (r *NullableStructuredFieldRule) Confidence() float64

func (*NullableStructuredFieldRule) Meta

type NullableToStringCallRule

type NullableToStringCallRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- NullableToStringCallRule detects .toString() on nullable. ---------------------------------------------------------------------------

func (*NullableToStringCallRule) Confidence

func (r *NullableToStringCallRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — needs resolver to know whether the receiver is nullable; heuristic fallback matches common null-returning APIs. Classified per roadmap/17.

func (*NullableToStringCallRule) IsFixable

func (r *NullableToStringCallRule) IsFixable() bool

func (*NullableToStringCallRule) Meta

func (*NullableToStringCallRule) NodeTypes

func (r *NullableToStringCallRule) NodeTypes() []string

type ObjectAnimatorBindingRule

type ObjectAnimatorBindingRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ObjectAnimatorBindingRule) Confidence

func (r *ObjectAnimatorBindingRule) Confidence() float64

func (*ObjectAnimatorBindingRule) Meta

type ObjectExtendsThrowableRule

type ObjectExtendsThrowableRule struct {
	FlatDispatchBase
	BaseRule
}

ObjectExtendsThrowableRule detects object : Exception/Throwable/Error.

func (*ObjectExtendsThrowableRule) Confidence

func (r *ObjectExtendsThrowableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — relies on resolver to determine supertypes; falls back to name-based heuristics on the `Throwable` identifier. Classified per roadmap/17.

func (*ObjectExtendsThrowableRule) Meta

type ObjectLiteralToLambdaRule

type ObjectLiteralToLambdaRule struct {
	FlatDispatchBase
	BaseRule
}

ObjectLiteralToLambdaRule detects object literals that could be lambdas. With type inference: uses ClassHierarchy to detect SAM interfaces from dependencies and other project files beyond the hardcoded allowlist.

func (*ObjectLiteralToLambdaRule) Confidence

func (r *ObjectLiteralToLambdaRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. SAM conversion eligibility depends on whether the supertype is a single-abstract-method interface, which needs either a class hierarchy from the resolver or a hardcoded allow-list — both paths miss project-defined SAM interfaces. The rule also can't easily detect when the object literal captures state or has side-effect init blocks that prevent conversion.

func (*ObjectLiteralToLambdaRule) IsFixable

func (r *ObjectLiteralToLambdaRule) IsFixable() bool

func (*ObjectLiteralToLambdaRule) Meta

type ObjectPropertyNamingRule

type ObjectPropertyNamingRule struct {
	FlatDispatchBase
	BaseRule
	ConstPattern           *regexp.Regexp
	PropertyPattern        *regexp.Regexp
	PrivatePropertyPattern *regexp.Regexp
}

ObjectPropertyNamingRule checks property names inside object declarations.

func (*ObjectPropertyNamingRule) Confidence

func (r *ObjectPropertyNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*ObjectPropertyNamingRule) Meta

type ObsoleteLayoutParamsResourceRule

type ObsoleteLayoutParamsResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

ObsoleteLayoutParamsResourceRule detects layout_weight on children of non-LinearLayout parents. The layout_weight attribute is only meaningful inside a LinearLayout.

func (*ObsoleteLayoutParamsResourceRule) Confidence

func (r *ObsoleteLayoutParamsResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*ObsoleteLayoutParamsResourceRule) Meta

type ObsoleteLayoutParamsRule

type ObsoleteLayoutParamsRule struct {
	FlatDispatchBase
	AndroidRule
}

ObsoleteLayoutParamsRule detects deprecated Compose layout modifier APIs that were renamed in Compose 1.0 (e.g. preferredWidth -> width).

func (*ObsoleteLayoutParamsRule) Confidence

func (r *ObsoleteLayoutParamsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ObsoleteLayoutParamsRule) Meta

type OkHTTPCallExecuteSyncRule

type OkHTTPCallExecuteSyncRule struct {
	FlatDispatchBase
	BaseRule
}

OkHTTPCallExecuteSyncRule detects Call.execute() inside suspend functions where enqueue() with a callback should be used instead.

func (*OkHTTPCallExecuteSyncRule) Confidence

func (r *OkHTTPCallExecuteSyncRule) Confidence() float64

func (*OkHTTPCallExecuteSyncRule) Meta

type OkHTTPClientCreatedPerCallRule

type OkHTTPClientCreatedPerCallRule struct {
	FlatDispatchBase
	BaseRule
}

OkHTTPClientCreatedPerCallRule detects OkHttpClient() or OkHttpClient.Builder().build() in non-singleton function bodies.

func (*OkHTTPClientCreatedPerCallRule) Confidence

func (r *OkHTTPClientCreatedPerCallRule) Confidence() float64

func (*OkHTTPClientCreatedPerCallRule) Meta

type OkHTTPDisableSslValidationRule

type OkHTTPDisableSslValidationRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*OkHTTPDisableSslValidationRule) Confidence

func (r *OkHTTPDisableSslValidationRule) Confidence() float64

func (*OkHTTPDisableSslValidationRule) Meta

type OnClickResourceRule

type OnClickResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

OnClickResourceRule detects android:onClick attributes in layout XML. Using onClick in XML is discouraged in favor of View.setOnClickListener in code, which is type-safe and does not rely on reflection.

func (*OnClickResourceRule) Confidence

func (r *OnClickResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*OnClickResourceRule) Meta

type OnClickRule

type OnClickRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*OnClickRule) Confidence

func (r *OnClickRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*OnClickRule) Meta

func (r *OnClickRule) Meta() api.RuleDescriptor

type OpenForTestingCallerInNonTestRule

type OpenForTestingCallerInNonTestRule struct {
	BaseRule
}

OpenForTestingCallerInNonTestRule flags subclasses of @OpenForTesting types outside test source sets.

func (*OpenForTestingCallerInNonTestRule) Confidence

func (*OpenForTestingCallerInNonTestRule) Meta

type OptInMarkerExposedPubliclyRule

type OptInMarkerExposedPubliclyRule struct {
	FlatDispatchBase
	BaseRule
}

OptInMarkerExposedPubliclyRule flags `@OptIn` annotations on public API declarations. Opt-in markers propagate to callers, so applying `@OptIn` to a public declaration silently forces every caller to opt in too.

func (*OptInMarkerExposedPubliclyRule) Confidence

func (r *OptInMarkerExposedPubliclyRule) Confidence() float64

Confidence reports a tier-1 (high) base confidence. The detection is fully AST-driven: we match `@OptIn` annotations whose target declaration has no non-public visibility modifier.

type OptInMarkerNotRecognisedRule

type OptInMarkerNotRecognisedRule struct {
	FlatDispatchBase
	BaseRule
	AdditionalMarkers []string
}

OptInMarkerNotRecognisedRule flags `@OptIn(Foo::class)` annotations whose marker does not appear in the embedded well-known markers list. A stale reference often indicates an experimental API that has graduated or been removed.

func (*OptInMarkerNotRecognisedRule) Confidence

func (r *OptInMarkerNotRecognisedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Licensing rule. The embedded marker list cannot enumerate every project-local OptIn marker, so callers can extend it via configuration. Classified per roadmap/17.

type OptInWithoutJustificationRule

type OptInWithoutJustificationRule struct {
	BaseRule
}

OptInWithoutJustificationRule flags `@OptIn(...)` annotations whose enclosing declaration lacks a preceding KDoc comment explaining why the opt-in is safe.

func (*OptInWithoutJustificationRule) Confidence

func (r *OptInWithoutJustificationRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Licensing rule.

type OptionalAbstractKeywordRule

type OptionalAbstractKeywordRule struct {
	FlatDispatchBase
	BaseRule
}

OptionalAbstractKeywordRule detects abstract keyword on interface members.

func (*OptionalAbstractKeywordRule) Confidence

func (r *OptionalAbstractKeywordRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/classes rule. Detection relies on modifier and declaration structure plus (optional) resolver-backed inheritance checks; the fallback path is heuristic. Classified per roadmap/17.

func (*OptionalAbstractKeywordRule) IsFixable

func (r *OptionalAbstractKeywordRule) IsFixable() bool

func (*OptionalAbstractKeywordRule) Meta

type OptionalUnitRule

type OptionalUnitRule struct {
	FlatDispatchBase
	BaseRule
}

OptionalUnitRule detects explicit `: Unit` return types on functions and redundant `return Unit` statements inside function bodies.

func (*OptionalUnitRule) Confidence

func (r *OptionalUnitRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/redundant rule. Detection flags visible but arguably-redundant modifiers, types, or keywords. Whether removal improves readability is context-dependent. Classified per roadmap/17.

func (*OptionalUnitRule) IsFixable

func (r *OptionalUnitRule) IsFixable() bool

func (*OptionalUnitRule) Meta

type OrientationResourceRule

type OrientationResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

OrientationResourceRule detects LinearLayout without an explicit android:orientation attribute. The default is horizontal, which is often not what developers intend.

func (*OrientationResourceRule) Confidence

func (r *OrientationResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*OrientationResourceRule) Meta

type OssLicensesNotIncludedInAndroidRule

type OssLicensesNotIncludedInAndroidRule struct {
	GradleBase
	BaseRule
}

OssLicensesNotIncludedInAndroidRule flags Android application modules that declare implementation dependencies but neither apply the Play Services OSS Licenses plugin nor ship a LICENSE file alongside the build script. Without either, a release APK has no attribution surface for its third-party deps.

func (*OssLicensesNotIncludedInAndroidRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Licensing rule. Detection combines Gradle plugin-list parsing with attribution-file presence; vendored licenses under non-standard names produce false positives. Classified per roadmap/17.

type OutdatedDocumentationRule

type OutdatedDocumentationRule struct {
	FlatDispatchBase
	BaseRule
	MatchDeclarationsOrder bool
	MatchTypeParameters    bool
}

OutdatedDocumentationRule detects @param tags that don't match actual function parameters.

func (*OutdatedDocumentationRule) Confidence

func (r *OutdatedDocumentationRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*OutdatedDocumentationRule) Meta

type OverdrawResourceRule

type OverdrawResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

OverdrawResourceRule detects a root layout with a background where an immediate child layout also has a background. This causes overdraw — the GPU paints pixels that are immediately covered by the child's background.

func (*OverdrawResourceRule) Confidence

func (r *OverdrawResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*OverdrawResourceRule) Meta

type OverrideAbstractRule

type OverrideAbstractRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*OverrideAbstractRule) Confidence

func (r *OverrideAbstractRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*OverrideAbstractRule) Meta

type OverrideRule

type OverrideRule struct {
	FlatDispatchBase
	AndroidRule
}

OverrideRule detects methods that need `override` for correct behavior across API levels. Currently checks for `fun onBackPressed()` without `override` in Activity/Fragment subclasses.

func (*OverrideRule) Confidence

func (r *OverrideRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*OverrideRule) Meta

func (r *OverrideRule) Meta() api.RuleDescriptor

type OverrideSignatureMismatchRule added in v0.2.0

type OverrideSignatureMismatchRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- OverrideSignatureMismatchRule — flags `override fun X(...)` declarations whose parameter count does not match any same-named function on a supertype the resolver can see. Mimics kotlinc's NOTHING_TO_OVERRIDE diagnostic for the case the resolver can prove from source: same-workspace supertypes with a same-named member but a different parameter count.

The rule is intentionally narrow:

  • Only fires when at least one supertype known to the resolver contains a function with the same name. If no supertype has the name, the rule is silent (could be a library override, deferred to classpath-aware resolution).
  • Compares parameter COUNTS only. Type comparison is deferred until parameter types are reliably resolved across files (today, library-typed parameters are TypeUnknown and would false-positive).
  • Generic functions and library supertypes are out of scope.

---------------------------------------------------------------------------

func (*OverrideSignatureMismatchRule) Confidence added in v0.2.0

func (r *OverrideSignatureMismatchRule) Confidence() float64

type PackageDependencyCycleRule

type PackageDependencyCycleRule struct {
	BaseRule
}

PackageDependencyCycleRule reports cycles in the package-level import graph within a single Gradle module.

func (*PackageDependencyCycleRule) Confidence

func (r *PackageDependencyCycleRule) Confidence() float64

Confidence holds the 0.95 dispatch default — cycle detection on the package-level import graph is a precise Tarjan/DFS result; a reported cycle is a real cycle. No heuristic path.

func (*PackageDependencyCycleRule) Meta

func (*PackageDependencyCycleRule) ModuleAwareNeeds

func (r *PackageDependencyCycleRule) ModuleAwareNeeds() ModuleAwareNeeds

type PackageDependencyEdge

type PackageDependencyEdge struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type PackageDependencyGraphData

type PackageDependencyGraphData struct {
	Packages []string                `json:"packages"`
	Edges    []PackageDependencyEdge `json:"edges"`
}

func PackageDependencyGraph

func PackageDependencyGraph(files []*scanner.File) PackageDependencyGraphData

type PackageNamingConventionDriftRule

type PackageNamingConventionDriftRule struct {
	FlatDispatchBase
	BaseRule
}

PackageNamingConventionDriftRule reports Kotlin source files whose package declaration no longer follows the directory path under src/main/kotlin.

func (*PackageNamingConventionDriftRule) Confidence

func (r *PackageNamingConventionDriftRule) Confidence() float64

Confidence holds the 0.95 dispatch default — package-header drift is a purely structural comparison against the expected prefix derived from the source root path. No heuristic path.

func (*PackageNamingConventionDriftRule) Meta

type PackageNamingRule

type PackageNamingRule struct {
	FlatDispatchBase
	BaseRule
	Pattern *regexp.Regexp
}

PackageNamingRule checks package names.

func (*PackageNamingRule) Confidence

func (r *PackageNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*PackageNamingRule) Meta

type ParcelCreatorRule

type ParcelCreatorRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ParcelCreatorRule) Confidence

func (r *ParcelCreatorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ParcelCreatorRule) Meta

type PeriodicWorkRequestLessThan15MinRule

type PeriodicWorkRequestLessThan15MinRule struct {
	FlatDispatchBase
	BaseRule
}

PeriodicWorkRequestLessThan15MinRule detects PeriodicWorkRequestBuilder with an interval less than 15 minutes.

func (*PeriodicWorkRequestLessThan15MinRule) Confidence

func (*PeriodicWorkRequestLessThan15MinRule) Meta

type PermissionImpliesUnsupportedHardwareManifestRule

type PermissionImpliesUnsupportedHardwareManifestRule struct {
	ManifestBase
	AndroidRule
}

PermissionImpliesUnsupportedHardwareManifestRule detects permissions that imply hardware features (e.g., CAMERA implies android.hardware.camera) when those features are not declared with android:required="false". This can prevent the app from being installed on devices without that hardware.

func (*PermissionImpliesUnsupportedHardwareManifestRule) Meta

type PlainFileWriteOfSensitiveRule

type PlainFileWriteOfSensitiveRule struct {
	FlatDispatchBase
	BaseRule
}

PlainFileWriteOfSensitiveRule flags writeText/writeBytes calls on File objects whose filename contains sensitive patterns.

func (*PlainFileWriteOfSensitiveRule) Confidence

func (r *PlainFileWriteOfSensitiveRule) Confidence() float64

func (*PlainFileWriteOfSensitiveRule) Meta

type PluralsBuiltWithIfElseRule

type PluralsBuiltWithIfElseRule struct {
	FlatDispatchBase
	BaseRule
}

PluralsBuiltWithIfElseRule detects manual pluralization built with an if/else over `count == 1` whose branches produce string literals or templates instead of using getQuantityString / pluralStringResource.

func (*PluralsBuiltWithIfElseRule) Confidence

func (r *PluralsBuiltWithIfElseRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Heuristic shape match: identifier name + literal-1 comparison + string-producing branches. Classified per roadmap/17.

type PluralsCandidateRule

type PluralsCandidateRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*PluralsCandidateRule) Confidence

func (r *PluralsCandidateRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*PluralsCandidateRule) Meta

type PluralsMissingZeroRule

type PluralsMissingZeroRule struct {
	ValuesPluralsResourceBase
	AndroidRule
}

PluralsMissingZeroRule flags <plurals> definitions in values-LL/ folders for languages whose CLDR plural rules include a "zero" category but that do not declare an `<item quantity="zero">`.

func (*PluralsMissingZeroRule) Confidence

func (r *PluralsMissingZeroRule) Confidence() float64

Confidence reports a tier-3 (high) base confidence — locale-folder gating plus a literal child-tag check leaves little room for misidentification.

type Precision

type Precision string

Precision labels the dominant implementation model for a rule.

const (
	PrecisionASTBacked           Precision = "ast-backed"
	PrecisionTypeAware           Precision = "type-aware"
	PrecisionProjectStructure    Precision = "project-structure-aware"
	PrecisionHeuristicTextBacked Precision = "heuristic/text-backed"
	PrecisionPolicy              Precision = "policy"
)

func V2RulePrecision

func V2RulePrecision(r *api.Rule) Precision

V2RulePrecision returns the dominant precision class for a rule.

type PrintStackTraceInProductionRule

type PrintStackTraceInProductionRule struct {
	FlatDispatchBase
	BaseRule
}

PrintStackTraceInProductionRule flags e.printStackTrace() calls in non-test files that import a logging framework.

func (*PrintStackTraceInProductionRule) Confidence

func (r *PrintStackTraceInProductionRule) Confidence() float64

func (*PrintStackTraceInProductionRule) Meta

type PrintStackTraceRule

type PrintStackTraceRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- PrintStackTraceRule detects .printStackTrace() calls. ---------------------------------------------------------------------------

func (*PrintStackTraceRule) Confidence

func (r *PrintStackTraceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs exceptions rule. Detection matches exception type names and throw/catch shapes; name-only fallback fires on project types sharing the same simple name. Classified per roadmap/17.

func (*PrintStackTraceRule) IsFixable

func (r *PrintStackTraceRule) IsFixable() bool

Exceptions rules

func (*PrintStackTraceRule) Meta

type PrintlnInProductionRule

type PrintlnInProductionRule struct {
	FlatDispatchBase
	BaseRule
}

PrintlnInProductionRule flags println/print/System.out.println/System.err.println in non-test files, outside a top-level fun main().

func (*PrintlnInProductionRule) Confidence

func (r *PrintlnInProductionRule) Confidence() float64

func (*PrintlnInProductionRule) Meta

type PrivateKeyRule

type PrivateKeyRule struct {
	LineBase
	AndroidRule
}

PrivateKeyRule detects private key content in source.

func (*PrivateKeyRule) Confidence

func (r *PrivateKeyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*PrivateKeyRule) Meta

func (r *PrivateKeyRule) Meta() api.RuleDescriptor

type PrngFromSystemTimeRule

type PrngFromSystemTimeRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*PrngFromSystemTimeRule) Confidence

func (r *PrngFromSystemTimeRule) Confidence() float64

func (*PrngFromSystemTimeRule) Meta

type ProcessBuilderShellArgRule

type ProcessBuilderShellArgRule struct {
	FlatDispatchBase
	BaseRule
}

ProcessBuilderShellArgRule detects shell ProcessBuilder invocations whose script argument is computed from non-static data.

func (*ProcessBuilderShellArgRule) Confidence

func (r *ProcessBuilderShellArgRule) Confidence() float64

func (*ProcessBuilderShellArgRule) Meta

type ProguardRule

type ProguardRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ProguardRule) Confidence

func (r *ProguardRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ProguardRule) Meta

func (r *ProguardRule) Meta() api.RuleDescriptor

type ProguardSplitRule

type ProguardSplitRule struct {
	LineBase
	AndroidRule
}

func (*ProguardSplitRule) Confidence

func (r *ProguardSplitRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ProguardSplitRule) Meta

type PropertyEscapeRule

type PropertyEscapeRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*PropertyEscapeRule) Confidence

func (r *PropertyEscapeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*PropertyEscapeRule) Meta

type PropertyUsedBeforeDeclarationRule

type PropertyUsedBeforeDeclarationRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- PropertyUsedBeforeDeclarationRule detects using property before declared. Uses DispatchBase on class_body to correctly identify class-level properties and avoid false positives from function bodies, lambdas, and init blocks. ---------------------------------------------------------------------------

func (*PropertyUsedBeforeDeclarationRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Potential-bugs properties rule. Detection is structural with heuristic fallbacks for flow-dependent cases. Classified per roadmap/17.

func (*PropertyUsedBeforeDeclarationRule) Meta

type ProtectedMemberInFinalClassRule

type ProtectedMemberInFinalClassRule struct {
	FlatDispatchBase
	BaseRule
}

ProtectedMemberInFinalClassRule detects protected members in final classes. With type inference: verifies via ClassHierarchy that no subclass exists, confirming the class is truly final even if it appears in a different module.

func (*ProtectedMemberInFinalClassRule) Confidence

func (r *ProtectedMemberInFinalClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — flags protected members on non-open classes; class-openness detection depends on declared modifiers plus resolver for inherited finality. Classified per roadmap/17.

func (*ProtectedMemberInFinalClassRule) IsFixable

func (r *ProtectedMemberInFinalClassRule) IsFixable() bool

func (*ProtectedMemberInFinalClassRule) Meta

type ProtectedPermissionsManifestRule

type ProtectedPermissionsManifestRule struct {
	ManifestBase
	AndroidRule
}

ProtectedPermissionsManifestRule detects requests for system-only (signature|system) permissions that third-party apps cannot obtain.

func (*ProtectedPermissionsManifestRule) Meta

type ProviderInsteadOfLazyRule

type ProviderInsteadOfLazyRule struct {
	FlatDispatchBase
	BaseRule
}

ProviderInsteadOfLazyRule detects constructor parameters typed Provider<T> whose `.get()` is called exactly once across the class body. Lazy<T> matches the same intent and is cheaper.

func (*ProviderInsteadOfLazyRule) Confidence

func (r *ProviderInsteadOfLazyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*ProviderInsteadOfLazyRule) Meta

type PublicToInternalLeakyAbstractionRule

type PublicToInternalLeakyAbstractionRule struct {
	LineBase
	BaseRule
	Threshold float64
}

PublicToInternalLeakyAbstractionRule detects public classes that wrap a single private/internal delegate and forward most methods to it. Such wrappers typically indicate the public type is a leaky facade over an internal implementation. Inactive by default.

func (*PublicToInternalLeakyAbstractionRule) Confidence

Confidence is 0.70 — the line-based heuristic (single-param constructor + single-expression method bodies delegating to the field) has real false-positive paths: adapters, type-safe wrappers, and DI holders all look similar. Medium confidence keeps reviewers honest.

func (*PublicToInternalLeakyAbstractionRule) Meta

Meta returns the descriptor for PublicToInternalLeakyAbstractionRule. Mirrors config.go:625-629.

type PxUsageResourceRule

type PxUsageResourceRule struct {
	ResourceBase
	AndroidRule
}

PxUsageResourceRule detects dimension values specified in `px` instead of `dp` or `sp`. Pixel values do not scale across screen densities.

func (PxUsageResourceRule) AndroidDependencies

func (PxUsageResourceRule) AndroidDependencies() AndroidDataDependency

func (*PxUsageResourceRule) Confidence

func (r *PxUsageResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*PxUsageResourceRule) Meta

type RangeRule

type RangeRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*RangeRule) Confidence

func (r *RangeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule is structural and requires an explicit API/range anchor, but framework calls still depend on type-oracle call-target availability. Classified per roadmap/17.

func (*RangeRule) Meta

func (r *RangeRule) Meta() api.RuleDescriptor

func (*RangeRule) NodeTypes

func (r *RangeRule) NodeTypes() []string

type RangeUntilInsteadOfRangeToRule

type RangeUntilInsteadOfRangeToRule struct {
	FlatDispatchBase
	BaseRule
}

RangeUntilInsteadOfRangeToRule detects `until` usage that could use `..<`.

func (*RangeUntilInsteadOfRangeToRule) Confidence

func (r *RangeUntilInsteadOfRangeToRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection uses structural pattern matching on expressions; the suggested rewrite's readability is a style call. Classified per roadmap/17.

func (*RangeUntilInsteadOfRangeToRule) IsFixable

func (r *RangeUntilInsteadOfRangeToRule) IsFixable() bool

func (*RangeUntilInsteadOfRangeToRule) Meta

type RecycleRule

type RecycleRule struct {
	FlatDispatchBase
	AndroidRule
}

RecycleRule detects missing recycle()/close() calls for resources.

func (*RecycleRule) Confidence

func (r *RecycleRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*RecycleRule) Meta

func (r *RecycleRule) Meta() api.RuleDescriptor

type RecyclerAdapterStableIDsDefaultRule

type RecyclerAdapterStableIDsDefaultRule struct {
	FlatDispatchBase
	BaseRule
}

RecyclerAdapterStableIDsDefaultRule detects RecyclerView.Adapter subclasses that don't call setHasStableIds(true) and don't extend ListAdapter.

func (*RecyclerAdapterStableIDsDefaultRule) Confidence

func (*RecyclerAdapterStableIDsDefaultRule) Meta

type RecyclerAdapterWithoutDiffUtilRule

type RecyclerAdapterWithoutDiffUtilRule struct {
	FlatDispatchBase
	BaseRule
}

RecyclerAdapterWithoutDiffUtilRule detects RecyclerView.Adapter subclasses using notifyDataSetChanged() without DiffUtil or ListAdapter.

func (*RecyclerAdapterWithoutDiffUtilRule) Confidence

func (*RecyclerAdapterWithoutDiffUtilRule) Meta

type RecyclerViewInLazyColumnRule

type RecyclerViewInLazyColumnRule struct {
	FlatDispatchBase
	BaseRule
}

RecyclerViewInLazyColumnRule detects AndroidView wrapping a RecyclerView inside a LazyColumn/LazyRow.

func (*RecyclerViewInLazyColumnRule) Confidence

func (r *RecyclerViewInLazyColumnRule) Confidence() float64

func (*RecyclerViewInLazyColumnRule) Meta

type RedundantConstructorKeywordRule

type RedundantConstructorKeywordRule struct {
	FlatDispatchBase
	BaseRule
}

RedundantConstructorKeywordRule detects unnecessary `constructor` keyword. Flags primary constructors that use the explicit `constructor` keyword when there are no annotations or visibility modifiers on the constructor itself.

func (*RedundantConstructorKeywordRule) Confidence

func (r *RedundantConstructorKeywordRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/redundant rule. Detection flags visible but arguably-redundant modifiers, types, or keywords. Whether removal improves readability is context-dependent. Classified per roadmap/17.

func (*RedundantConstructorKeywordRule) IsFixable

func (r *RedundantConstructorKeywordRule) IsFixable() bool

RedundantConstructorKeyword: byte-mode fix removes the `constructor` keyword (and any preceding whitespace) up to the `(` that opens the parameter list.

func (*RedundantConstructorKeywordRule) Meta

type RedundantExplicitTypeRule

type RedundantExplicitTypeRule struct {
	FlatDispatchBase
	BaseRule
}

RedundantExplicitTypeRule detects type annotations where the type is obvious. With type inference: uses ResolveNode on both the declared type and the initializer expression. If both resolve to the same FQN, the explicit type is redundant.

func (*RedundantExplicitTypeRule) Confidence

func (r *RedundantExplicitTypeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — inferring whether the type annotation is necessary requires the resolver; fallback is conservative. Classified per roadmap/17.

func (*RedundantExplicitTypeRule) IsFixable

func (r *RedundantExplicitTypeRule) IsFixable() bool

func (*RedundantExplicitTypeRule) Meta

type RedundantHigherOrderMapUsageRule

type RedundantHigherOrderMapUsageRule struct {
	FlatDispatchBase
	BaseRule
}

RedundantHigherOrderMapUsageRule detects .map { it } (identity map).

func (*RedundantHigherOrderMapUsageRule) IsFixable

func (r *RedundantHigherOrderMapUsageRule) IsFixable() bool

func (*RedundantHigherOrderMapUsageRule) Meta

type RedundantSuspendModifierRule

type RedundantSuspendModifierRule struct {
	FlatDispatchBase
	BaseRule
}

RedundantSuspendModifierRule detects suspend functions with no suspend calls inside. With type inference: uses ResolveNode on call expressions to check if the call target is a suspend function, beyond the hardcoded known list. With oracle: uses KAA call-target metadata to distinguish resolved suspend calls from resolved non-suspend calls, with known FQN/name fallbacks for older oracle payloads.

func (*RedundantSuspendModifierRule) Confidence

func (r *RedundantSuspendModifierRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence because this rule uses a name-based allow-list (commonNonSuspendCallees) and a call-target suspend metadata and the known-suspend-FQN set to decide whether a call is suspending. It relies on the oracle for the accurate case; without it, any identifier not in the allow-list is treated as potentially-suspend and the rule suppresses the finding, so the remaining positives are reliable but the rule may miss cases where the suspend modifier is genuinely redundant.

func (*RedundantSuspendModifierRule) IsFixable

func (r *RedundantSuspendModifierRule) IsFixable() bool

func (*RedundantSuspendModifierRule) Meta

type RedundantVisibilityModifierRule

type RedundantVisibilityModifierRule struct {
	FlatDispatchBase
	BaseRule
}

RedundantVisibilityModifierRule detects explicit `public` keyword.

func (*RedundantVisibilityModifierRule) Confidence

func (r *RedundantVisibilityModifierRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/redundant rule. Detection flags visible but arguably-redundant modifiers, types, or keywords. Whether removal improves readability is context-dependent. Classified per roadmap/17.

func (*RedundantVisibilityModifierRule) IsFixable

func (r *RedundantVisibilityModifierRule) IsFixable() bool

func (*RedundantVisibilityModifierRule) Meta

type RegisteredRule

type RegisteredRule struct {
	FlatDispatchBase
	AndroidRule
}

RegisteredRule detects Activity/Service/BroadcastReceiver/ContentProvider subclasses and flags them with a reminder to register in AndroidManifest.xml. Skips classes annotated with @AndroidEntryPoint (Hilt auto-registers).

func (*RegisteredRule) Confidence

func (r *RegisteredRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*RegisteredRule) Meta

func (r *RegisteredRule) Meta() api.RuleDescriptor

type RelativeOverlapResourceRule

type RelativeOverlapResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

RelativeOverlapResourceRule detects views inside a RelativeLayout that may overlap because multiple children use alignParentLeft (or alignParentStart) without different vertical positioning constraints.

func (*RelativeOverlapResourceRule) Confidence

func (r *RelativeOverlapResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android RTL resource rule. Detection flags start/end vs left/right attribute usage and bidi markers via attribute presence checks. Classified per roadmap/17.

func (*RelativeOverlapResourceRule) Meta

type RelaxedMockUsedForValueClassRule

type RelaxedMockUsedForValueClassRule struct {
	FlatDispatchBase
	BaseRule
}

func (*RelaxedMockUsedForValueClassRule) Confidence

func (r *RelaxedMockUsedForValueClassRule) Confidence() float64

func (*RelaxedMockUsedForValueClassRule) Meta

type RemoteVersionRule

type RemoteVersionRule struct {
	GradleBase
	AndroidRule
}

RemoteVersionRule flags dependencies using "+" or "latest.release" as their version, which leads to non-deterministic builds.

func (*RemoteVersionRule) Confidence

func (r *RemoteVersionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*RemoteVersionRule) Meta

type ReplaceSafeCallChainWithRunRule

type ReplaceSafeCallChainWithRunRule struct {
	FlatDispatchBase
	BaseRule
}

ReplaceSafeCallChainWithRunRule detects 3+ chained safe calls (?.).

func (*ReplaceSafeCallChainWithRunRule) Confidence

func (r *ReplaceSafeCallChainWithRunRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*ReplaceSafeCallChainWithRunRule) Meta

type RequiredSizeResourceRule

type RequiredSizeResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

RequiredSizeResourceRule detects views missing android:layout_width or android:layout_height.

func (*RequiredSizeResourceRule) Confidence

func (r *RequiredSizeResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*RequiredSizeResourceRule) Meta

type RequiresOptInWithoutLevelRule

type RequiresOptInWithoutLevelRule struct {
	FlatDispatchBase
	BaseRule
}

RequiresOptInWithoutLevelRule flags custom `@RequiresOptIn` annotation classes that omit an explicit `level = WARNING|ERROR` argument. Without an explicit level callers see only the implicit default and have no signal from the source whether the marker is intended as a warning or an error.

func (*RequiresOptInWithoutLevelRule) Confidence

func (r *RequiresOptInWithoutLevelRule) Confidence() float64

Confidence reports a tier-1 (high) base confidence. The detection is AST-driven: we match `annotation class` declarations carrying a `@RequiresOptIn` annotation and inspect its `level = ...` argument.

type RequiresOptInWithoutMessageRule

type RequiresOptInWithoutMessageRule struct {
	FlatDispatchBase
	BaseRule
}

RequiresOptInWithoutMessageRule flags `@RequiresOptIn` annotations that omit a `message` argument. Without an explanatory message, callers who must opt in have no in-source guidance about the experimental contract.

func (*RequiresOptInWithoutMessageRule) Confidence

func (r *RequiresOptInWithoutMessageRule) Confidence() float64

Confidence reports a tier-1 (high) base confidence. The check is a pure AST match on `@RequiresOptIn(...)` argument labels.

type ResAutoResourceRule

type ResAutoResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

ResAutoResourceRule detects hardcoded package namespaces in resource XML. Attributes using http://schemas.android.com/apk/res/<package> should use http://schemas.android.com/apk/res-auto instead.

func (*ResAutoResourceRule) Confidence

func (r *ResAutoResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*ResAutoResourceRule) Meta

type ResourceAsColorRule

type ResourceAsColorRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ResourceAsColorRule) Confidence

func (r *ResourceAsColorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ResourceAsColorRule) Meta

type ResourceBase

type ResourceBase struct{}

func (ResourceBase) AndroidDependencies

func (ResourceBase) AndroidDependencies() AndroidDataDependency

type ResourceNameRule

type ResourceNameRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ResourceNameRule) Confidence

func (r *ResourceNameRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ResourceNameRule) Meta

type ResourceTypeRule

type ResourceTypeRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ResourceTypeRule) Confidence

func (r *ResourceTypeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ResourceTypeRule) Meta

type RethrowCaughtExceptionRule

type RethrowCaughtExceptionRule struct {
	FlatDispatchBase
	BaseRule
}

RethrowCaughtExceptionRule detects catch { throw e } where e is the caught variable.

func (*RethrowCaughtExceptionRule) Confidence

func (r *RethrowCaughtExceptionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*RethrowCaughtExceptionRule) Meta

type RetrofitCreateInHotPathRule

type RetrofitCreateInHotPathRule struct {
	FlatDispatchBase
	BaseRule
}

RetrofitCreateInHotPathRule detects Retrofit.Builder()...build().create() in non-init, non-object function bodies.

func (*RetrofitCreateInHotPathRule) Confidence

func (r *RetrofitCreateInHotPathRule) Confidence() float64

func (*RetrofitCreateInHotPathRule) Meta

type ReturnCountRule

type ReturnCountRule struct {
	FlatDispatchBase
	BaseRule
	Max                     int
	ExcludedFunctions       []string // function names excluded from this rule
	ExcludeLabeled          bool
	ExcludeReturnFromLambda bool
	ExcludeGuardClauses     bool
}

ReturnCountRule limits the number of return statements in a function.

func (*ReturnCountRule) Confidence

func (r *ReturnCountRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule's counting is deterministic, but the threshold is a style preference with active disagreement (guard-clause handling, early-return patterns, when-expression with throw). The ExcludeGuardClauses and ExcludeReturnFromLambda knobs mitigate but don't eliminate the subjectivity. Medium keeps it out of strict default-confidence gates without removing it from the rule set.

func (*ReturnCountRule) Meta

type ReturnFromFinallyRule

type ReturnFromFinallyRule struct {
	FlatDispatchBase
	BaseRule
	IgnoreLabeled bool
}

ReturnFromFinallyRule detects return statements inside finally blocks.

func (*ReturnFromFinallyRule) Confidence

func (r *ReturnFromFinallyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*ReturnFromFinallyRule) IsFixable

func (r *ReturnFromFinallyRule) IsFixable() bool

func (*ReturnFromFinallyRule) Meta

type RoomConflictStrategyReplaceOnFkRule

type RoomConflictStrategyReplaceOnFkRule struct {
	FlatDispatchBase
	BaseRule
}

RoomConflictStrategyReplaceOnFkRule detects @Insert(onConflict = REPLACE) on Room DAO methods whose target entity declares foreign keys. REPLACE deletes and re-inserts the row, which cascades FK deletes.

func (*RoomConflictStrategyReplaceOnFkRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names without confirming the parameter resolves to a Room @Entity class.

func (*RoomConflictStrategyReplaceOnFkRule) Meta

type RoomDatabaseVersionNotBumpedRule

type RoomDatabaseVersionNotBumpedRule struct {
	BaseRule
}

RoomDatabaseVersionNotBumpedRule detects @Database classes whose version literal is unchanged since HEAD while at least one @Entity-bearing source file has changed in the working tree. CI-only: skipped unless KRIT_CI_MODE=1 and git is available.

func (*RoomDatabaseVersionNotBumpedRule) Confidence

func (r *RoomDatabaseVersionNotBumpedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Schema-change detection is best-effort and depends on git diff state.

func (*RoomDatabaseVersionNotBumpedRule) Meta

type RoomEntityChangedMigrationMissingRule

type RoomEntityChangedMigrationMissingRule struct {
	FlatDispatchBase
	BaseRule
}

RoomEntityChangedMigrationMissingRule detects @Entity columns whose names do not appear in any Room Migration(M, N) declaration in the project. A newly added or removed column without a corresponding migration update will fail Room's schema validation at runtime.

func (*RoomEntityChangedMigrationMissingRule) Confidence

Confidence reports a tier-3 (low) base confidence. Detection cannot tell when a column was introduced; pre-existing columns left out of migration SQL also match. Inactive by default.

func (*RoomEntityChangedMigrationMissingRule) Meta

type RoomExportSchemaDisabledRule

type RoomExportSchemaDisabledRule struct {
	FlatDispatchBase
	BaseRule
}

RoomExportSchemaDisabledRule detects Room @Database(exportSchema = false) declarations. Disabling schema export loses migration history.

func (*RoomExportSchemaDisabledRule) Confidence

func (r *RoomExportSchemaDisabledRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection matches on annotation names without confirming the annotated class is androidx.room.Database.

func (*RoomExportSchemaDisabledRule) Meta

type RoomFallbackToDestructiveMigrationRule

type RoomFallbackToDestructiveMigrationRule struct {
	FlatDispatchBase
	BaseRule
}

RoomFallbackToDestructiveMigrationRule detects calls to `fallbackToDestructiveMigration` on a Room database builder outside debug source sets. Falling back to destructive migration silently drops user data on a schema version bump.

func (*RoomFallbackToDestructiveMigrationRule) Confidence

func (*RoomFallbackToDestructiveMigrationRule) Meta

type RoomFlowQueryWithoutDistinctRule

type RoomFlowQueryWithoutDistinctRule struct {
	BaseRule
}

RoomFlowQueryWithoutDistinctRule detects callers of Room @Query DAO functions returning Flow<...> that omit a chained .distinctUntilChanged().

func (*RoomFlowQueryWithoutDistinctRule) Confidence

func (r *RoomFlowQueryWithoutDistinctRule) Confidence() float64

Confidence reports a tier-3 (low) base confidence. DAO method names are matched by identifier and may collide with same-named methods on non-DAO receivers; callers that hold the Flow in an intermediate variable are not flagged.

func (*RoomFlowQueryWithoutDistinctRule) IsFixable

func (r *RoomFlowQueryWithoutDistinctRule) IsFixable() bool

func (*RoomFlowQueryWithoutDistinctRule) Meta

type RoomLoadsAllWhereFirstUsedRule

type RoomLoadsAllWhereFirstUsedRule struct {
	FlatDispatchBase
	BaseRule
}

RoomLoadsAllWhereFirstUsedRule detects dao.getAll().first() or similar patterns that load an entire table for a single element.

func (*RoomLoadsAllWhereFirstUsedRule) Confidence

func (r *RoomLoadsAllWhereFirstUsedRule) Confidence() float64

func (*RoomLoadsAllWhereFirstUsedRule) Meta

type RoomMigrationUsesExecSQLWithInterpolationRule

type RoomMigrationUsesExecSQLWithInterpolationRule struct {
	FlatDispatchBase
	BaseRule
}

RoomMigrationUsesExecSQLWithInterpolationRule detects `db.execSQL(...)` calls inside a class or object that extends Room's `Migration`, where the SQL string uses Kotlin string interpolation. Interpolated DDL inside a migration is brittle and a SQL-injection foot-gun.

func (*RoomMigrationUsesExecSQLWithInterpolationRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Detection matches on the call name and an enclosing supertype named `Migration`, without confirming androidx.room.migration.Migration resolves the type.

func (*RoomMigrationUsesExecSQLWithInterpolationRule) Meta

type RoomMultipleWritesMissingTransactionRule

type RoomMultipleWritesMissingTransactionRule struct {
	FlatDispatchBase
	BaseRule
}

RoomMultipleWritesMissingTransactionRule detects DAO functions whose body contains 2+ calls to sibling DAO methods annotated @Insert/@Update/@Delete while the enclosing function itself is not @Transaction.

func (*RoomMultipleWritesMissingTransactionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection is name-based against sibling DAO methods and does not resolve types across files.

func (*RoomMultipleWritesMissingTransactionRule) Meta

type RoomQueryMissingWhereForUpdateRule

type RoomQueryMissingWhereForUpdateRule struct {
	FlatDispatchBase
	BaseRule
}

RoomQueryMissingWhereForUpdateRule detects @Query("UPDATE ...") or @Query("DELETE ...") whose SQL text omits a WHERE clause, unless the DAO function name signals a deliberate full-table operation (deleteAll/clearAll).

func (*RoomQueryMissingWhereForUpdateRule) Confidence

Confidence reports a tier-2 (medium) base confidence. The check matches on annotation name and SQL keywords without confirming the annotated function is a Room DAO member.

func (*RoomQueryMissingWhereForUpdateRule) Meta

type RoomQueryWithLikeMissingEscapeRule

type RoomQueryWithLikeMissingEscapeRule struct {
	FlatDispatchBase
	BaseRule
}

RoomQueryWithLikeMissingEscapeRule detects @Query SQL containing `LIKE :param` where the bind parameter is used directly without wildcard embedding (`'%' || :p || '%'`) or an ESCAPE directive, suggesting the binding is interpreted as an exact match rather than a pattern.

func (*RoomQueryWithLikeMissingEscapeRule) Confidence

Confidence reports a tier-3 (low) base confidence. The check operates on annotation text without confirming the function is a Room DAO member, and rule semantics depend on the developer's intent for the LIKE pattern.

func (*RoomQueryWithLikeMissingEscapeRule) Meta

type RoomRawQueryStringConcatRule

type RoomRawQueryStringConcatRule struct {
	FlatDispatchBase
	BaseRule
}

RoomRawQueryStringConcatRule detects Room SimpleSQLiteQuery SQL strings built from interpolation or non-static concatenation without bind args.

func (*RoomRawQueryStringConcatRule) Confidence

func (r *RoomRawQueryStringConcatRule) Confidence() float64

func (*RoomRawQueryStringConcatRule) Meta

type RoomRelationWithoutIndexRule

type RoomRelationWithoutIndexRule struct {
	FlatDispatchBase
	BaseRule
}

RoomRelationWithoutIndexRule detects @Relation properties whose referenced entityColumn is not declared in the target @Entity's indices list.

func (*RoomRelationWithoutIndexRule) Confidence

func (r *RoomRelationWithoutIndexRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Detection matches on annotation names without confirming the resolved type is a Room entity.

func (*RoomRelationWithoutIndexRule) Meta

type RoomSelectStarWithoutLimitRule

type RoomSelectStarWithoutLimitRule struct {
	FlatDispatchBase
	BaseRule
}

RoomSelectStarWithoutLimitRule detects Room @Query("SELECT * ...") whose SQL has no LIMIT clause and whose function returns an unbounded materialised collection (i.e., not a Flow/SharedFlow/StateFlow/PagingSource/Observable).

func (*RoomSelectStarWithoutLimitRule) Confidence

func (r *RoomSelectStarWithoutLimitRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The check matches on annotation name and SQL text, plus a textual return-type check, without confirming the annotated function is a Room DAO member.

func (*RoomSelectStarWithoutLimitRule) Meta

type RoomSuspendQueryInTransactionRule

type RoomSuspendQueryInTransactionRule struct {
	FlatDispatchBase
	BaseRule
}

RoomSuspendQueryInTransactionRule detects DAO functions that are both `@Transaction` and `suspend` and call into sibling `suspend @Query` functions. Room already wraps suspending queries in a transaction, so the outer `@Transaction` double-wraps and breaks cancellation.

func (*RoomSuspendQueryInTransactionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Database/Room rule. Detection is name-based against sibling DAO suspend @Query methods and does not resolve types across files.

func (*RoomSuspendQueryInTransactionRule) Meta

type RsaNoPaddingRule

type RsaNoPaddingRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*RsaNoPaddingRule) Confidence

func (r *RsaNoPaddingRule) Confidence() float64

func (*RsaNoPaddingRule) Meta

type RtlAwareRule

type RtlAwareRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*RtlAwareRule) Confidence

func (r *RtlAwareRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*RtlAwareRule) Meta

func (r *RtlAwareRule) Meta() api.RuleDescriptor

type RtlCompatManifestRule

type RtlCompatManifestRule struct {
	ManifestBase
	AndroidRule
}

RtlCompatManifestRule detects targetSdkVersion >= 17 without supportsRtl="true" on the application element. API 17 introduced native RTL layout support; apps targeting 17+ should enable it.

func (*RtlCompatManifestRule) Meta

type RtlEnabledManifestRule

type RtlEnabledManifestRule struct {
	ManifestBase
	AndroidRule
}

RtlEnabledManifestRule detects missing android:supportsRtl="true" on the <application> element. Supporting RTL layouts is recommended for internationalization.

func (*RtlEnabledManifestRule) Meta

type RtlFieldAccessRule

type RtlFieldAccessRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*RtlFieldAccessRule) Confidence

func (r *RtlFieldAccessRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*RtlFieldAccessRule) Meta

type RtlHardcodedResourceRule

type RtlHardcodedResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

RtlHardcodedResourceRule detects layout_marginLeft/Right and paddingLeft/Right instead of their Start/End equivalents, which breaks RTL support.

func (*RtlHardcodedResourceRule) Confidence

func (r *RtlHardcodedResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android RTL resource rule. Detection flags start/end vs left/right attribute usage and bidi markers via attribute presence checks. Classified per roadmap/17.

func (*RtlHardcodedResourceRule) Meta

type RtlSuperscriptResourceRule

type RtlSuperscriptResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

RtlSuperscriptResourceRule detects superscript/subscript text styling that may break in RTL locales.

func (*RtlSuperscriptResourceRule) Confidence

func (r *RtlSuperscriptResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android RTL resource rule. Detection flags start/end vs left/right attribute usage and bidi markers via attribute presence checks. Classified per roadmap/17.

func (*RtlSuperscriptResourceRule) Meta

type RtlSymmetryResourceRule

type RtlSymmetryResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

RtlSymmetryResourceRule detects asymmetric padding or margin. If a view specifies paddingLeft but not paddingRight (or marginLeft but not marginRight), the layout will look unbalanced in RTL locales.

func (*RtlSymmetryResourceRule) Confidence

func (r *RtlSymmetryResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android RTL resource rule. Detection flags start/end vs left/right attribute usage and bidi markers via attribute presence checks. Classified per roadmap/17.

func (*RtlSymmetryResourceRule) Meta

type RuleExecutionStat

type RuleExecutionStat struct {
	Rule        string  `json:"rule"`
	Family      string  `json:"family"`
	Invocations int64   `json:"invocations"`
	DurationNs  int64   `json:"durationNs"`
	DurationMs  float64 `json:"durationMs"`
	AvgNs       int64   `json:"avgNs"`
	SharePct    float64 `json:"sharePct"`
}

RuleExecutionStat captures per-rule CPU timing for one per-file rule family. DurationNs is cumulative callback CPU time across files, not wall time; parallel runs can therefore sum above the ruleExecution wall bucket.

func SortedRuleExecutionStats

func SortedRuleExecutionStats(stats RunStats) []RuleExecutionStat

SortedRuleExecutionStats returns deterministic, descending per-rule timing rows with derived averages and percentage share filled in.

type RunBlockingInTestRule

type RunBlockingInTestRule struct {
	FlatDispatchBase
	BaseRule
}

func (*RunBlockingInTestRule) Confidence

func (r *RunBlockingInTestRule) Confidence() float64

func (*RunBlockingInTestRule) Meta

type RunStats

type RunStats struct {
	SuppressionIndexMs   int64
	DispatchWalkMs       int64
	DispatchRuleNs       int64
	AggregateCollectNs   int64
	AggregateFinalizeMs  int64
	LineRuleMs           int64
	SuppressionFilterMs  int64
	DispatchRuleNsByRule map[string]int64
	RuleStatsByRule      map[string]RuleExecutionStat
	Errors               []DispatchError
}

RunStats captures where per-file rule execution time is spent.

type RunTestWithDelayRule

type RunTestWithDelayRule struct {
	FlatDispatchBase
	BaseRule
}

func (*RunTestWithDelayRule) Confidence

func (r *RunTestWithDelayRule) Confidence() float64

func (*RunTestWithDelayRule) Meta

type RunTestWithThreadSleepRule

type RunTestWithThreadSleepRule struct {
	FlatDispatchBase
	BaseRule
}

func (*RunTestWithThreadSleepRule) Confidence

func (r *RunTestWithThreadSleepRule) Confidence() float64

func (*RunTestWithThreadSleepRule) Meta

type RuntimeExecUnsafeShapeRule

type RuntimeExecUnsafeShapeRule struct {
	FlatDispatchBase
	BaseRule
}

RuntimeExecUnsafeShapeRule detects Runtime.getRuntime().exec(String) calls whose single command string is computed from non-static data.

func (*RuntimeExecUnsafeShapeRule) Confidence

func (r *RuntimeExecUnsafeShapeRule) Confidence() float64

func (*RuntimeExecUnsafeShapeRule) Meta

type SQLInjectionRawQueryRule

type SQLInjectionRawQueryRule struct {
	FlatDispatchBase
	BaseRule
}

SQLInjectionRawQueryRule detects SQLiteDatabase SQL arguments built from interpolation or non-static concatenation.

func (*SQLInjectionRawQueryRule) Confidence

func (r *SQLInjectionRawQueryRule) Confidence() float64

func (*SQLInjectionRawQueryRule) Meta

type SQLiteStringRule

type SQLiteStringRule struct {
	FlatDispatchBase
	AndroidRule
}

SQLiteStringRule detects SQL string issues (using string instead of TEXT).

func (*SQLiteStringRule) Confidence

func (r *SQLiteStringRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*SQLiteStringRule) Meta

type SafeCastRule

type SafeCastRule struct {
	FlatDispatchBase
	BaseRule
}

SafeCastRule detects `if (x is Type) { x as Type }` patterns that should use `x as? Type`. This is distinct from UnsafeCast, which is reserved for casts that can never succeed. SafeCast only fires when an is-check + cast pattern is detected (the cast is redundant because the is-check already proves the type).

func (*SafeCastRule) Confidence

func (r *SafeCastRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule matches the `if (x is T) { x as T }` pattern on text, which is narrow enough to avoid most false positives but can stumble on multi-branch or shadowed variables. Roadmap/17 notes that this rule and UnsafeCast fire on overlapping locations; medium confidence is appropriate for the redundant-cast half of that pair.

func (*SafeCastRule) IsFixable

func (r *SafeCastRule) IsFixable() bool

func (*SafeCastRule) Meta

func (r *SafeCastRule) Meta() api.RuleDescriptor

type SampleAnnotationFreshnessRule

type SampleAnnotationFreshnessRule struct {
	BaseRule
}

SampleAnnotationFreshnessRule detects KDoc @sample tags whose target function is missing.

func (*SampleAnnotationFreshnessRule) Confidence

func (r *SampleAnnotationFreshnessRule) Confidence() float64

Confidence reflects exact FQN lookup through the cross-file symbol index.

func (*SampleAnnotationFreshnessRule) Meta

type ScopeOnParameterizedClassRule

type ScopeOnParameterizedClassRule struct {
	FlatDispatchBase
	BaseRule
}

ScopeOnParameterizedClassRule detects scope annotations on generic classes, where the type parameter is erased at runtime so the scope holds a single instance regardless of the type argument.

func (*ScopeOnParameterizedClassRule) Confidence

func (r *ScopeOnParameterizedClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*ScopeOnParameterizedClassRule) Meta

type ScreenshotNotBlockedOnLoginScreenRule

type ScreenshotNotBlockedOnLoginScreenRule struct {
	FlatDispatchBase
	BaseRule
}

ScreenshotNotBlockedOnLoginScreenRule flags Activity classes or @Composable functions whose name suggests a sensitive screen but do not set FLAG_SECURE.

func (*ScreenshotNotBlockedOnLoginScreenRule) Confidence

func (*ScreenshotNotBlockedOnLoginScreenRule) Meta

type ScrollViewCountResourceRule

type ScrollViewCountResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

ScrollViewCountResourceRule detects ScrollView or HorizontalScrollView with more than one direct child.

func (*ScrollViewCountResourceRule) Confidence

func (r *ScrollViewCountResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*ScrollViewCountResourceRule) Meta

type ScrollViewCountRule

type ScrollViewCountRule struct {
	FlatDispatchBase
	AndroidRule
}

ScrollViewCountRule detects ScrollView with multiple children. Primarily XML (see ScrollViewCountResourceRule); the Kotlin source heuristic flags `ScrollView(...).apply { addView; addView }` patterns.

func (*ScrollViewCountRule) Confidence

func (r *ScrollViewCountRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ScrollViewCountRule) Meta

type ScrollViewSizeResourceRule

type ScrollViewSizeResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

ScrollViewSizeResourceRule detects ScrollView children that use match_parent on the scrolling axis. A vertical ScrollView's child should use wrap_content for layout_height; a HorizontalScrollView's child should use wrap_content for layout_width.

func (*ScrollViewSizeResourceRule) Confidence

func (r *ScrollViewSizeResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*ScrollViewSizeResourceRule) Meta

type SdCardPathRule

type SdCardPathRule struct {
	FlatDispatchBase
	AndroidRule
}

SdCardPathRule detects hardcoded /sdcard paths.

func (*SdCardPathRule) Confidence

func (r *SdCardPathRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*SdCardPathRule) Meta

func (r *SdCardPathRule) Meta() api.RuleDescriptor

type SecureRandomRule

type SecureRandomRule struct {
	FlatDispatchBase
	AndroidRule
}

SecureRandomRule detects insecure random usage: java.util.Random where SecureRandom should be used, and deterministic SecureRandom.setSeed(long) calls that Android lint reports as SecureRandom issues.

func (*SecureRandomRule) Confidence

func (r *SecureRandomRule) Confidence() float64

func (*SecureRandomRule) Meta

type SerialVersionUIDInSerializableClassRule

type SerialVersionUIDInSerializableClassRule struct {
	FlatDispatchBase
	BaseRule
}

SerialVersionUIDInSerializableClassRule detects missing serialVersionUID. With type inference: uses ClassHierarchy to verify the class actually implements java.io.Serializable (could be transitive through a supertype).

func (*SerialVersionUIDInSerializableClassRule) Confidence

Confidence reports a tier-2 (medium) base confidence — Serializable detection uses supertype names; without resolver, falls back to matching `Serializable` in the delegation list. Classified per roadmap/17.

func (*SerialVersionUIDInSerializableClassRule) IsFixable

SerialVersionUIDInSerializableClass: fix injects a `private const val serialVersionUID: Long = 1L` into the class — adding it to an existing companion object when present, or creating one otherwise.

func (*SerialVersionUIDInSerializableClassRule) Meta

type ServiceCastRule

type ServiceCastRule struct {
	FlatDispatchBase
	AndroidRule
}

ServiceCastRule flags getSystemService() calls cast to the wrong type. For example, getSystemService(ALARM_SERVICE) as PowerManager.

func (*ServiceCastRule) Confidence

func (r *ServiceCastRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ServiceCastRule) Meta

type ServiceExportedManifestRule

type ServiceExportedManifestRule struct {
	ManifestBase
	AndroidRule
}

ServiceExportedManifestRule checks for exported services without a permission attribute. Uses the AOSP IssueID "ServiceExported" for @SuppressLint compatibility. This is the AOSP-compatible variant of ExportedServiceManifest.

func (*ServiceExportedManifestRule) Meta

type SetJavaScriptEnabledRule

type SetJavaScriptEnabledRule struct {
	FlatDispatchBase
	AndroidRule
}

SetJavaScriptEnabledRule detects setJavaScriptEnabled(true) calls.

func (*SetJavaScriptEnabledRule) Confidence

func (r *SetJavaScriptEnabledRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*SetJavaScriptEnabledRule) Meta

type SetTextI18nRule

type SetTextI18nRule struct {
	FlatDispatchBase
	AndroidRule
}

SetTextI18nRule detects setText() with hardcoded text.

func (*SetTextI18nRule) Meta

type SharedFlowWithoutReplayRule

type SharedFlowWithoutReplayRule struct {
	FlatDispatchBase
	BaseRule
}

SharedFlowWithoutReplayRule detects MutableSharedFlow() with no buffer config.

func (*SharedFlowWithoutReplayRule) Confidence

func (r *SharedFlowWithoutReplayRule) Confidence() float64

func (*SharedFlowWithoutReplayRule) Meta

type SharedMutableStateInObjectRule

type SharedMutableStateInObjectRule struct {
	FlatDispatchBase
	BaseRule
}

func (*SharedMutableStateInObjectRule) Confidence

func (r *SharedMutableStateInObjectRule) Confidence() float64

func (*SharedMutableStateInObjectRule) Meta

type SharedPreferencesForSensitiveKeyRule

type SharedPreferencesForSensitiveKeyRule struct {
	FlatDispatchBase
	BaseRule
}

SharedPreferencesForSensitiveKeyRule flags putString/putInt/putLong calls on SharedPreferences with a key literal matching sensitive patterns. Sensitive data should use EncryptedSharedPreferences or the Keystore.

func (*SharedPreferencesForSensitiveKeyRule) Confidence

func (*SharedPreferencesForSensitiveKeyRule) Meta

type ShiftFlagsRule

type ShiftFlagsRule struct {
	FlatDispatchBase
	AndroidRule
}

ShiftFlagsRule detects flag constants not using shift operators.

func (*ShiftFlagsRule) Confidence

func (r *ShiftFlagsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ShiftFlagsRule) Meta

func (r *ShiftFlagsRule) Meta() api.RuleDescriptor

type ShortAlarmRule

type ShortAlarmRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ShortAlarmRule) Confidence

func (r *ShortAlarmRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ShortAlarmRule) Meta

func (r *ShortAlarmRule) Meta() api.RuleDescriptor

type SimpleDateFormatRule

type SimpleDateFormatRule struct {
	FlatDispatchBase
	AndroidRule
}

SimpleDateFormatRule detects SimpleDateFormat without Locale.

func (*SimpleDateFormatRule) Confidence

func (r *SimpleDateFormatRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*SimpleDateFormatRule) Meta

type SingletonOnMutableClassRule

type SingletonOnMutableClassRule struct {
	FlatDispatchBase
	BaseRule
}

SingletonOnMutableClassRule detects @Singleton (or other application-scoped) classes whose body declares unprotected mutable state — `var` properties or `val` properties initialised with a mutable collection factory.

func (*SingletonOnMutableClassRule) Confidence

func (r *SingletonOnMutableClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. DI hygiene rule.

func (*SingletonOnMutableClassRule) Meta

type SleepInsteadOfDelayRule

type SleepInsteadOfDelayRule struct {
	FlatDispatchBase
	BaseRule
}

SleepInsteadOfDelayRule detects Thread.sleep() usage inside suspend functions and coroutine builder lambdas (launch, async, runBlocking, withContext, etc.).

func (*SleepInsteadOfDelayRule) Confidence

func (r *SleepInsteadOfDelayRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Coroutines rule. Detection matches kotlinx.coroutines call shapes via name lists and structural patterns; project wrappers can escape or collide. Classified per roadmap/17.

func (*SleepInsteadOfDelayRule) IsFixable

func (r *SleepInsteadOfDelayRule) IsFixable() bool

Coroutines rules

func (*SleepInsteadOfDelayRule) Meta

type SmallSpResourceRule

type SmallSpResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

SmallSpResourceRule detects android:textSize values below 12sp, which may be too small to read comfortably on most devices.

func (*SmallSpResourceRule) Confidence

func (r *SmallSpResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*SmallSpResourceRule) Meta

type SmartCastInvalidatedRule added in v0.2.0

type SmartCastInvalidatedRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- SmartCastInvalidatedRule — flags reassignment of a smart-cast variable followed by an unsafe navigation/call use of the same name within the same if-body scope. Mimics kotlinc's SMARTCAST_IMPOSSIBLE for the local-`var` pattern:

var x: String? = "a"
if (x != null) {
    x = bar()
    println(x.length)  // SMARTCAST_IMPOSSIBLE
}

The rule is intentionally narrow:

  • Only fires when the variable is declared with `var` somewhere in the enclosing function body (parameters and properties are out of scope — parameters can't be reassigned in Kotlin, and class properties have different rules the resolver tracks).
  • Only handles `if (x != null)` (and `if (x == null) return` early-exit is not considered here because reassignment after the early return would not invalidate a smart cast).
  • Only flags the first reassignment-then-use pair to keep messages tight.

---------------------------------------------------------------------------

func (*SmartCastInvalidatedRule) Confidence added in v0.2.0

func (r *SmartCastInvalidatedRule) Confidence() float64

type SpUsageResourceRule

type SpUsageResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

SpUsageResourceRule detects android:textSize using dp instead of sp. Text sizes should use sp (scaled pixels) so they respect the user's font size preference.

func (*SpUsageResourceRule) Confidence

func (r *SpUsageResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*SpUsageResourceRule) Meta

type SpacingAfterPackageAndImportsRule

type SpacingAfterPackageAndImportsRule struct {
	LineBase
	BaseRule
}

SpacingAfterPackageAndImportsRule checks for blank line after package/imports.

func (*SpacingAfterPackageAndImportsRule) Confidence

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 — the detection uses `strings.HasPrefix(trimmed, "package ")` and `"import "`, which are unambiguous line starts in Kotlin. No heuristic path.

func (*SpacingAfterPackageAndImportsRule) IsFixable

func (r *SpacingAfterPackageAndImportsRule) IsFixable() bool

func (*SpacingAfterPackageAndImportsRule) Meta

type SpanAttributeWithHighCardinalityRule

type SpanAttributeWithHighCardinalityRule struct {
	FlatDispatchBase
	BaseRule

	Keys []string
}

SpanAttributeWithHighCardinalityRule detects span attributes whose keys are commonly unique per user/session/request and therefore noisy in trace indexes.

func (*SpanAttributeWithHighCardinalityRule) Confidence

func (*SpanAttributeWithHighCardinalityRule) Meta

type SpanStartWithoutFinishRule

type SpanStartWithoutFinishRule struct {
	FlatDispatchBase
	BaseRule
}

SpanStartWithoutFinishRule detects spans started into local variables that are not closed by end(), use, or makeCurrent().use in the same scope.

func (*SpanStartWithoutFinishRule) Confidence

func (r *SpanStartWithoutFinishRule) Confidence() float64

func (*SpanStartWithoutFinishRule) Meta

type SparseArrayRule

type SparseArrayRule struct {
	FlatDispatchBase
	AndroidRule
}

SparseArrayRule flags HashMap<Integer, ...> / HashMap<Int, ...> usage where SparseArray or SparseIntArray would be more efficient on Android.

func (*SparseArrayRule) Confidence

func (r *SparseArrayRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*SparseArrayRule) Meta

type SpdxIdentifierInvalidRule

type SpdxIdentifierInvalidRule struct {
	LineBase
	BaseRule
	AdditionalIdentifiers []string
}

SpdxIdentifierInvalidRule flags `SPDX-License-Identifier:` header values that are not recognised SPDX short IDs.

func (*SpdxIdentifierInvalidRule) Confidence

func (r *SpdxIdentifierInvalidRule) Confidence() float64

Confidence reports a tier-1 (high) base confidence. False positives are limited to licenses trimmed from the embedded set; users can add them via additionalIdentifiers.

type SpdxIdentifierMismatchWithProjectRule

type SpdxIdentifierMismatchWithProjectRule struct {
	LineBase
	BaseRule
	ProjectLicense string
}

SpdxIdentifierMismatchWithProjectRule flags file headers whose SPDX identifier disagrees with the project-level license configured for the rule. Only fires when both the file header declares an SPDX id and the project license is configured.

func (*SpdxIdentifierMismatchWithProjectRule) Confidence

Confidence reports a tier-1 (high) base confidence. Detection compares the SPDX id parsed from the file header to the configured project license; both values are explicit, leaving little room for false positives.

type SpreadOperatorRule

type SpreadOperatorRule struct {
	FlatDispatchBase
	BaseRule
}

SpreadOperatorRule detects *array in function calls where an array copy is created. Excludes cases where the Kotlin compiler (1.1.60+) can skip the copy: - *arrayOf(...), *intArrayOf(...), etc. (array constructor calls) - *arrayOfNulls(...), *emptyArray()

func (*SpreadOperatorRule) Confidence

func (r *SpreadOperatorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Performance rule. Detection pattern-matches anti-patterns (allocation in loops, primitive boxing, collection chains) with optional resolver support; fallback is heuristic. Classified per roadmap/17.

func (*SpreadOperatorRule) Meta

type SpyOnDataClassRule

type SpyOnDataClassRule struct {
	FlatDispatchBase
	BaseRule
}

func (*SpyOnDataClassRule) Confidence

func (r *SpyOnDataClassRule) Confidence() float64

func (*SpyOnDataClassRule) Meta

type SqliteCursorWithoutCloseRule

type SqliteCursorWithoutCloseRule struct {
	FlatDispatchBase
	BaseRule
}

SqliteCursorWithoutCloseRule detects Android SQLiteDatabase rawQuery/query results assigned to local properties without a later .use {} or .close() in the same scope.

func (*SqliteCursorWithoutCloseRule) Confidence

func (r *SqliteCursorWithoutCloseRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Detection matches on method name without confirming the receiver is SQLiteDatabase.

func (*SqliteCursorWithoutCloseRule) Meta

type StartActivityWithUntrustedIntentRule

type StartActivityWithUntrustedIntentRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*StartActivityWithUntrustedIntentRule) Confidence

func (*StartActivityWithUntrustedIntentRule) Meta

type StateFlowCompareByReferenceRule

type StateFlowCompareByReferenceRule struct {
	FlatDispatchBase
	BaseRule
}

StateFlowCompareByReferenceRule detects .map{}.distinctUntilChanged() on StateFlow.

func (*StateFlowCompareByReferenceRule) Confidence

func (r *StateFlowCompareByReferenceRule) Confidence() float64

func (*StateFlowCompareByReferenceRule) Meta

type StateFlowMutableLeakRule

type StateFlowMutableLeakRule struct {
	FlatDispatchBase
	BaseRule
}

StateFlowMutableLeakRule detects publicly exposed MutableStateFlow.

func (*StateFlowMutableLeakRule) Confidence

func (r *StateFlowMutableLeakRule) Confidence() float64

func (*StateFlowMutableLeakRule) Meta

type StateListReachableResourceRule

type StateListReachableResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

StateListReachableResourceRule detects unreachable items in selector drawables. A non-last <item> with no state attributes (android:state_*) catches all states, making subsequent items unreachable.

func (*StateListReachableResourceRule) Confidence

func (r *StateListReachableResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android style/theme resource rule. Detection flags style inheritance anti-patterns and attribute mismatches via structural checks on style XML. Classified per roadmap/17.

func (*StateListReachableResourceRule) Meta

type StaticIvRule

type StaticIvRule struct {
	FlatDispatchBase
	AndroidRule
}

StaticIvRule detects IV/GCM parameter specs built from inline literal bytes.

func (*StaticIvRule) Confidence

func (r *StaticIvRule) Confidence() float64

func (*StaticIvRule) Meta

func (r *StaticIvRule) Meta() api.RuleDescriptor

type StopShipRule

type StopShipRule struct {
	LineBase
	AndroidRule
}

StopShipRule detects STOPSHIP comments.

func (*StopShipRule) Confidence

func (r *StopShipRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*StopShipRule) Meta

func (r *StopShipRule) Meta() api.RuleDescriptor

type StringConcatForTranslationRule

type StringConcatForTranslationRule struct {
	FlatDispatchBase
	BaseRule
}

StringConcatForTranslationRule flags `+` concatenation between a `stringResource(...)` call and any non-literal operand. Such concatenation hard-codes English word order; translators cannot reorder the placeholder and the runtime value. The replacement is to embed a positional placeholder in `strings.xml` and pass the value as an argument to `stringResource(R.string.X, value)`.

func (*StringConcatForTranslationRule) Confidence

func (r *StringConcatForTranslationRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Detection matches the call name `stringResource` without resolving the import site, so a same-named project symbol may produce a false match.

type StringContainsHTMLWithoutCDATARule

type StringContainsHTMLWithoutCDATARule struct {
	ValuesStringsResourceBase
	AndroidRule
}

StringContainsHTMLWithoutCDATARule flags <string> resources whose value contains literal `<` or `>` markup that is neither wrapped in a `<![CDATA[...]]>` section nor entity-escaped (`&lt;`, `&gt;`).

func (*StringContainsHTMLWithoutCDATARule) Confidence

type StringFormatCountResourceRule

type StringFormatCountResourceRule struct {
	ValuesStringsResourceBase
	AndroidRule
}

StringFormatCountResourceRule detects format strings where positional argument indices are inconsistent. For example, `%1$s and %3$s` is suspicious because %2$ is missing.

func (*StringFormatCountResourceRule) Confidence

func (r *StringFormatCountResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*StringFormatCountResourceRule) Meta

type StringFormatInvalidResourceRule

type StringFormatInvalidResourceRule struct {
	ValuesStringsResourceBase
	AndroidRule
}

StringFormatInvalidResourceRule detects invalid format specifiers in string resources. Checks for bare `%` at end of string, `%` followed by invalid conversion characters, etc. Valid: %s, %d, %f, %1$s, %%, %n, %x, %o, %e, %g.

func (*StringFormatInvalidResourceRule) Confidence

func (r *StringFormatInvalidResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*StringFormatInvalidResourceRule) Meta

type StringFormatMatchesResourceRule

type StringFormatMatchesResourceRule struct {
	ValuesPluralsResourceBase
	AndroidRule
}

StringFormatMatchesResourceRule detects format specifier type mismatches across plural quantities. If a plural has `%d` in "one" but `%s` in "other", the types are inconsistent and will likely cause a runtime crash.

func (*StringFormatMatchesResourceRule) Confidence

func (r *StringFormatMatchesResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*StringFormatMatchesResourceRule) Meta

type StringFormatTrivialResourceRule

type StringFormatTrivialResourceRule struct {
	ValuesStringsResourceBase
	AndroidRule
}

StringFormatTrivialResourceRule detects string resources whose whole value is a single string placeholder.

func (*StringFormatTrivialResourceRule) Confidence

func (r *StringFormatTrivialResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*StringFormatTrivialResourceRule) Meta

type StringIntegerRule

type StringIntegerRule struct {
	GradleBase
	AndroidRule
}

StringIntegerRule flags string values where integers are expected in Gradle build files — for example, minSdk = "24" instead of minSdk = 24.

func (*StringIntegerRule) Confidence

func (r *StringIntegerRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android Gradle rule. Detection scans Groovy/Kotlin DSL build scripts via line/regex matching; build-script shape varies by project and plugin version. Classified per roadmap/17.

func (*StringIntegerRule) Meta

StringIntegerRule is also registered as rule ID "StringShouldBeInt"; Meta() only represents the primary ID.

type StringLiteralDuplicationRule

type StringLiteralDuplicationRule struct {
	FlatDispatchBase
	BaseRule
	AllowedDuplications       int
	AllowedWithLengthLessThan int
	IgnoreAnnotation          bool
	IgnoreStringsRegex        string
}

StringLiteralDuplicationRule detects duplicate string literals in a file.

func (*StringLiteralDuplicationRule) Confidence

func (r *StringLiteralDuplicationRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*StringLiteralDuplicationRule) Meta

type StringNotLocalizableResourceRule

type StringNotLocalizableResourceRule struct {
	ValuesStringsResourceBase
	AndroidRule
}

StringNotLocalizableResourceRule detects string resources containing values that should not be localized, such as URLs, email addresses, or technical identifiers (all-uppercase strings).

func (*StringNotLocalizableResourceRule) Confidence

func (r *StringNotLocalizableResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*StringNotLocalizableResourceRule) Meta

type StringNotSelectableRule

type StringNotSelectableRule struct {
	LayoutResourceBase
	AndroidRule
}

func (*StringNotSelectableRule) Confidence

func (r *StringNotSelectableRule) Confidence() float64

func (*StringNotSelectableRule) Meta

type StringRepeatedInContentDescriptionRule

type StringRepeatedInContentDescriptionRule struct {
	LayoutResourceBase
	AndroidRule
}

func (*StringRepeatedInContentDescriptionRule) Confidence

func (*StringRepeatedInContentDescriptionRule) Meta

type StringResourceMissingPositionalRule

type StringResourceMissingPositionalRule struct {
	ValuesStringsResourceBase
	AndroidRule
}

StringResourceMissingPositionalRule detects translatable <string> resources containing two or more non-positional format specifiers (`%s`, `%d`, ...) without any positional indices. Languages that reorder arguments need `%1$s %2$s` form; bare `%s %s` cannot be reordered by translators.

func (*StringResourceMissingPositionalRule) Confidence

Confidence reports a tier-2 (medium) base confidence.

func (*StringResourceMissingPositionalRule) Meta

type StringResourcePlaceholderOrderRule

type StringResourcePlaceholderOrderRule struct {
	ValuesStringsResourceBase
	AndroidRule
}

StringResourcePlaceholderOrderRule flags translation variants that drop positional format syntax (`%1$s`, `%2$s`) when the default string uses it. Without positional indexes, a translator cannot reorder arguments to match target-language word order, and the runtime mapping is silently lost.

func (*StringResourcePlaceholderOrderRule) Confidence

type StringShouldBeRawStringRule

type StringShouldBeRawStringRule struct {
	FlatDispatchBase
	BaseRule
	MaxEscapes int
}

StringShouldBeRawStringRule detects strings with many escape characters.

func (*StringShouldBeRawStringRule) Confidence

func (r *StringShouldBeRawStringRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection uses structural pattern matching on expressions; the suggested rewrite's readability is a style call. Classified per roadmap/17.

func (*StringShouldBeRawStringRule) IsFixable

func (r *StringShouldBeRawStringRule) IsFixable() bool

Style2 not fixable — too many edge cases

func (*StringShouldBeRawStringRule) Meta

type StringSpanInContentDescriptionRule

type StringSpanInContentDescriptionRule struct {
	LayoutResourceBase
	AndroidRule
}

func (*StringSpanInContentDescriptionRule) Confidence

func (*StringSpanInContentDescriptionRule) Meta

type StringTemplateForTranslationRule

type StringTemplateForTranslationRule struct {
	FlatDispatchBase
	BaseRule
}

StringTemplateForTranslationRule flags Kotlin string templates that embed a `stringResource(...)` interpolation alongside another dynamic interpolation. Like its concatenation sibling, the construct hard-codes English word order; translators cannot reorder the placeholder relative to the runtime value. The replacement is to embed positional placeholders in `strings.xml` and pass the values as arguments to `stringResource(R.string.X, value)`.

func (*StringTemplateForTranslationRule) Confidence

func (r *StringTemplateForTranslationRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Detection matches the call name `stringResource` without resolving the import site, so a same-named project symbol may produce a false match.

type StringTrailingWhitespaceResourceRule

type StringTrailingWhitespaceResourceRule struct {
	ValuesStringsResourceBase
	AndroidRule
}

StringTrailingWhitespaceResourceRule detects translatable <string> resource values whose raw text ends with whitespace. Trailing whitespace is significant in some locales and in concatenated strings, so it is almost always a mistake unless the resource is marked translatable="false".

func (*StringTrailingWhitespaceResourceRule) Confidence

Confidence reports a tier-2 (medium) base confidence.

func (*StringTrailingWhitespaceResourceRule) Meta

type StructuredLogKeyMixedCaseRule

type StructuredLogKeyMixedCaseRule struct {
	LineBase
	BaseRule

	MinKeys          int
	ThresholdPercent int
}

StructuredLogKeyMixedCaseRule detects files that mostly use one structured logging key convention but contain minority keys using the other convention.

func (*StructuredLogKeyMixedCaseRule) Confidence

func (r *StructuredLogKeyMixedCaseRule) Confidence() float64

func (*StructuredLogKeyMixedCaseRule) Meta

type SubcomponentNotInstalledRule

type SubcomponentNotInstalledRule struct {
	FlatDispatchBase
	BaseRule
}

SubcomponentNotInstalledRule detects `@Subcomponent` declarations that are never returned from any parent `@Component` or parent `@Subcomponent` method, leaving the subcomponent orphaned.

func (*SubcomponentNotInstalledRule) Confidence

func (r *SubcomponentNotInstalledRule) Confidence() float64

Confidence reports a tier-3 (lower) base confidence. Detection follows return-type text only; cross-module install graphs are not modeled.

func (*SubcomponentNotInstalledRule) Meta

type SupervisorScopeInEventHandlerRule

type SupervisorScopeInEventHandlerRule struct {
	FlatDispatchBase
	BaseRule
}

SupervisorScopeInEventHandlerRule detects supervisorScope with a single child operation.

func (*SupervisorScopeInEventHandlerRule) Confidence

func (*SupervisorScopeInEventHandlerRule) Meta

type SupportAnnotationUsageRule

type SupportAnnotationUsageRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*SupportAnnotationUsageRule) Confidence

func (r *SupportAnnotationUsageRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*SupportAnnotationUsageRule) Meta

type SuppressedWarningWithoutJustificationRule

type SuppressedWarningWithoutJustificationRule struct {
	BaseRule
}

SuppressedWarningWithoutJustificationRule flags `@Suppress(...)` annotations whose enclosing declaration lacks a preceding KDoc comment explaining why silencing the warning is safe.

func (*SuppressedWarningWithoutJustificationRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Licensing rule.

type SuspendFunInFinallySectionRule

type SuspendFunInFinallySectionRule struct {
	FlatDispatchBase
	BaseRule
}

SuspendFunInFinallySectionRule detects suspend calls in finally blocks.

func (*SuspendFunInFinallySectionRule) Confidence

func (r *SuspendFunInFinallySectionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Coroutines rule. Detection matches kotlinx.coroutines call shapes via name lists and structural patterns; project wrappers can escape or collide. Classified per roadmap/17.

func (*SuspendFunInFinallySectionRule) Meta

type SuspendFunSwallowedCancellationRule

type SuspendFunSwallowedCancellationRule struct {
	FlatDispatchBase
	BaseRule
}

SuspendFunSwallowedCancellationRule detects catching CancellationException without rethrow.

func (*SuspendFunSwallowedCancellationRule) Confidence

Confidence reports a tier-2 (medium) base confidence — detecting which catch blocks swallow CancellationException without rethrow is structural but depends on the resolver to recognize aliases of CancellationException. Classified per roadmap/17.

func (*SuspendFunSwallowedCancellationRule) IsFixable

func (*SuspendFunSwallowedCancellationRule) Meta

type SuspendFunWithCoroutineScopeReceiverRule

type SuspendFunWithCoroutineScopeReceiverRule struct {
	FlatDispatchBase
	BaseRule
}

SuspendFunWithCoroutineScopeReceiverRule detects suspend fun CoroutineScope.x().

func (*SuspendFunWithCoroutineScopeReceiverRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Coroutines rule. Detection matches kotlinx.coroutines call shapes via name lists and structural patterns; project wrappers can escape or collide. Classified per roadmap/17.

func (*SuspendFunWithCoroutineScopeReceiverRule) IsFixable

func (*SuspendFunWithCoroutineScopeReceiverRule) Meta

type SuspendFunWithFlowReturnTypeRule

type SuspendFunWithFlowReturnTypeRule = coroutines.SuspendFunWithFlowReturnTypeRule

SuspendFunWithFlowReturnTypeRule detects suspend fun returning Flow. SuspendFunWithFlowReturnTypeRule has been moved to internal/rules/coroutines as the first rule of the per-domain subpackage migration. The alias keeps Meta() / IsFixable() and the AllMetaProviders sample list working unchanged.

type Suspicious0dpResourceRule

type Suspicious0dpResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

Suspicious0dpResourceRule detects 0dp dimension used on the wrong axis in a LinearLayout. In horizontal orientation, 0dp should be on layout_width (for weight distribution); 0dp on layout_height is suspicious (and vice versa).

func (*Suspicious0dpResourceRule) Meta

type SwallowedExceptionRule

type SwallowedExceptionRule struct {
	FlatDispatchBase
	BaseRule
	AllowedExceptionNameRegex *regexp.Regexp // exception names matching this are allowed to be swallowed
	IgnoredExceptionTypes     []string       // exception types that are allowed to be swallowed
	LoggingCountsAsHandling   bool
}

SwallowedExceptionRule detects catch blocks that either never use the exception variable or that throw a new exception without passing the original as the cause. Referencing only e.message or e.toString() (directly or via a variable) in a throw counts as swallowed.

func (*SwallowedExceptionRule) Confidence

func (r *SwallowedExceptionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*SwallowedExceptionRule) IsFixable

func (r *SwallowedExceptionRule) IsFixable() bool

Exceptions rules (new fixable)

func (*SwallowedExceptionRule) Meta

type SwitchIntDefRule

type SwitchIntDefRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*SwitchIntDefRule) Confidence

func (r *SwitchIntDefRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*SwitchIntDefRule) Meta

type SynchronizedOnBoxedPrimitiveRule

type SynchronizedOnBoxedPrimitiveRule struct {
	FlatDispatchBase
	BaseRule
}

SynchronizedOnBoxedPrimitiveRule detects synchronized() on boxed primitives.

func (*SynchronizedOnBoxedPrimitiveRule) Confidence

func (r *SynchronizedOnBoxedPrimitiveRule) Confidence() float64

func (*SynchronizedOnBoxedPrimitiveRule) Meta

type SynchronizedOnNonFinalRule

type SynchronizedOnNonFinalRule struct {
	FlatDispatchBase
	BaseRule
}

SynchronizedOnNonFinalRule detects synchronized() on a var property.

func (*SynchronizedOnNonFinalRule) Confidence

func (r *SynchronizedOnNonFinalRule) Confidence() float64

func (*SynchronizedOnNonFinalRule) Meta

type SynchronizedOnStringRule

type SynchronizedOnStringRule struct {
	FlatDispatchBase
	BaseRule
}

SynchronizedOnStringRule detects synchronized() with a string literal lock.

func (*SynchronizedOnStringRule) Confidence

func (r *SynchronizedOnStringRule) Confidence() float64

func (*SynchronizedOnStringRule) Meta

type SystemPermissionRule

type SystemPermissionRule struct {
	ManifestBase
	AndroidRule
}

SystemPermissionRule flags requests for dangerous system permissions that require runtime permission grants and careful justification.

func (*SystemPermissionRule) Meta

type TargetNewerRule

type TargetNewerRule struct {
	ManifestBase
	AndroidRule
}

TargetNewerRule checks that targetSdkVersion is reasonably recent (>= 33).

func (*TargetNewerRule) Meta

type TempFileWorldReadableRule

type TempFileWorldReadableRule struct {
	FlatDispatchBase
	BaseRule
}

TempFileWorldReadableRule detects setReadable/setWritable/setExecutable(true, false) on a File that came from File.createTempFile or Files.createTempFile, which makes the temporary file world-accessible.

func (*TempFileWorldReadableRule) Confidence

func (r *TempFileWorldReadableRule) Confidence() float64

func (*TempFileWorldReadableRule) Meta

type TestDispatcherNotInjectedRule

type TestDispatcherNotInjectedRule struct {
	FlatDispatchBase
	BaseRule
}

func (*TestDispatcherNotInjectedRule) Confidence

func (r *TestDispatcherNotInjectedRule) Confidence() float64

func (*TestDispatcherNotInjectedRule) Meta

type TestFixtureAccessedFromProductionRule

type TestFixtureAccessedFromProductionRule struct {
	BaseRule
}

TestFixtureAccessedFromProductionRule flags usage of types declared under src/testFixtures/ from non-test files.

func (*TestFixtureAccessedFromProductionRule) Confidence

func (*TestFixtureAccessedFromProductionRule) Meta

type TestFunctionReturnValueRule

type TestFunctionReturnValueRule struct {
	FlatDispatchBase
	BaseRule
}

func (*TestFunctionReturnValueRule) Confidence

func (r *TestFunctionReturnValueRule) Confidence() float64

func (*TestFunctionReturnValueRule) Meta

type TestInheritanceDepthRule

type TestInheritanceDepthRule struct {
	FlatDispatchBase
	BaseRule
}

func (*TestInheritanceDepthRule) Confidence

func (r *TestInheritanceDepthRule) Confidence() float64

func (*TestInheritanceDepthRule) Meta

type TestNameContainsUnderscoreRule

type TestNameContainsUnderscoreRule struct {
	FlatDispatchBase
	BaseRule
}

func (*TestNameContainsUnderscoreRule) Confidence

func (r *TestNameContainsUnderscoreRule) Confidence() float64

func (*TestNameContainsUnderscoreRule) Meta

type TestOnlyImportInProductionRule

type TestOnlyImportInProductionRule struct {
	FlatDispatchBase
	BaseRule
}

TestOnlyImportInProductionRule flags test-framework imports in non-test files.

func (*TestOnlyImportInProductionRule) Confidence

func (r *TestOnlyImportInProductionRule) Confidence() float64

func (*TestOnlyImportInProductionRule) Meta

type TestWithOnlyTodoRule

type TestWithOnlyTodoRule struct {
	FlatDispatchBase
	BaseRule
}

func (*TestWithOnlyTodoRule) Confidence

func (r *TestWithOnlyTodoRule) Confidence() float64

func (*TestWithOnlyTodoRule) Meta

type TestWithoutAssertionRule

type TestWithoutAssertionRule struct {
	FlatDispatchBase
	BaseRule

	AllowNoAssertionTests   bool
	AssertionMethodPatterns []string
}

func (*TestWithoutAssertionRule) Confidence

func (r *TestWithoutAssertionRule) Confidence() float64

func (*TestWithoutAssertionRule) Meta

type TextDirectionLiteralInStringRule

type TextDirectionLiteralInStringRule struct {
	FlatDispatchBase
	BaseRule
}

TextDirectionLiteralInStringRule flags string literals that embed Unicode BIDI control characters (LRM, RLM, LRE/RLE/PDF/LRO/RLO, LRI/RLI/FSI/PDI). Hard-coding these characters bakes a particular directional override into the data and tends to break in mixed-locale rendering. Use BidiFormatter (or platform equivalents) to wrap text with the right embedding for the runtime locale.

func (*TextDirectionLiteralInStringRule) Confidence

func (r *TextDirectionLiteralInStringRule) Confidence() float64

Confidence reports a tier-3 (high) base confidence. The BIDI control codepoints have no other meaning in a string literal, so a literal match is unambiguous.

type TextFieldsResourceRule

type TextFieldsResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

TextFieldsResourceRule detects EditText views that have neither inputType nor hint specified. Without inputType the keyboard may be inappropriate.

func (*TextFieldsResourceRule) Confidence

func (r *TextFieldsResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*TextFieldsResourceRule) Meta

type TextViewEditsRule

type TextViewEditsRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*TextViewEditsRule) Confidence

func (r *TextViewEditsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*TextViewEditsRule) Meta

type ThrowingExceptionFromFinallyRule

type ThrowingExceptionFromFinallyRule struct {
	FlatDispatchBase
	BaseRule
}

ThrowingExceptionFromFinallyRule detects throw inside finally blocks.

func (*ThrowingExceptionFromFinallyRule) Confidence

func (r *ThrowingExceptionFromFinallyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*ThrowingExceptionFromFinallyRule) IsFixable

func (r *ThrowingExceptionFromFinallyRule) IsFixable() bool

func (*ThrowingExceptionFromFinallyRule) Meta

type ThrowingExceptionInMainRule

type ThrowingExceptionInMainRule struct {
	FlatDispatchBase
	BaseRule
}

ThrowingExceptionInMainRule detects throw in main function.

func (*ThrowingExceptionInMainRule) Confidence

func (r *ThrowingExceptionInMainRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*ThrowingExceptionInMainRule) Meta

type ThrowingExceptionsWithoutMessageOrCauseRule

type ThrowingExceptionsWithoutMessageOrCauseRule struct {
	FlatDispatchBase
	BaseRule
	Exceptions []string
	// contains filtered or unexported fields
}

ThrowingExceptionsWithoutMessageOrCauseRule detects throw Exception() with no args. Uses tree-sitter dispatch to find call_expression nodes, then checks if the parent is a throw (jump_expression) and the exception type is in the configured allowlist.

func (*ThrowingExceptionsWithoutMessageOrCauseRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*ThrowingExceptionsWithoutMessageOrCauseRule) Meta

type ThrowingNewInstanceOfSameExceptionRule

type ThrowingNewInstanceOfSameExceptionRule struct {
	FlatDispatchBase
	BaseRule
}

ThrowingNewInstanceOfSameExceptionRule detects catch(e: X) { throw X(e) }.

func (*ThrowingNewInstanceOfSameExceptionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Exceptions rule. Detection matches exception type names and catch/ throw shapes via structural AST + name-list lookups. Classified per roadmap/17.

func (*ThrowingNewInstanceOfSameExceptionRule) Meta

type ThrowsCountRule

type ThrowsCountRule struct {
	FlatDispatchBase
	BaseRule
	Max                 int
	ExcludeGuardClauses bool
}

ThrowsCountRule limits the number of throw statements in a function.

func (*ThrowsCountRule) Confidence

func (r *ThrowsCountRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection is pattern-based and the preferred form is a style preference. Classified per roadmap/17.

func (*ThrowsCountRule) Meta

type TimberTreeNotPlantedRule

type TimberTreeNotPlantedRule struct {
	BaseRule
}

TimberTreeNotPlantedRule flags projects that use Timber.d/i/w/e but have no Timber.plant() call reachable from Application.onCreate.

func (*TimberTreeNotPlantedRule) Confidence

func (r *TimberTreeNotPlantedRule) Confidence() float64

func (*TimberTreeNotPlantedRule) Meta

type ToastForAccessibilityAnnouncementRule

type ToastForAccessibilityAnnouncementRule struct {
	FlatDispatchBase
	BaseRule
}

func (*ToastForAccessibilityAnnouncementRule) Confidence

func (*ToastForAccessibilityAnnouncementRule) Meta

type ToastRule

type ToastRule struct {
	FlatDispatchBase
	AndroidRule
}

ToastRule flags Toast.makeText() calls where .show() is never called on the result. The Toast will not be displayed without show().

func (*ToastRule) Confidence

func (r *ToastRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ToastRule) Meta

func (r *ToastRule) Meta() api.RuleDescriptor

type TooDeepLayoutResourceRule

type TooDeepLayoutResourceRule struct {
	LayoutResourceBase
	AndroidRule
	MaxDepth int // default 10
}

TooDeepLayoutResourceRule detects layouts that exceed a nesting depth threshold. Deep nesting causes expensive measure/layout passes.

func (*TooDeepLayoutResourceRule) Confidence

func (r *TooDeepLayoutResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*TooDeepLayoutResourceRule) Meta

type TooGenericExceptionCaughtRule

type TooGenericExceptionCaughtRule struct {
	FlatDispatchBase
	BaseRule
	ExceptionNames            []string       // configurable list of generic exception types
	AllowedExceptionNameRegex *regexp.Regexp // exception var names matching this are allowed
}

TooGenericExceptionCaughtRule detects catching Exception/Throwable. ---------------------------------------------------------------------------

func (*TooGenericExceptionCaughtRule) Meta

type TooGenericExceptionThrownRule

type TooGenericExceptionThrownRule struct {
	FlatDispatchBase
	BaseRule
	ExceptionNames []string // configurable list of generic exception types
}

--------------------------------------------------------------------------- TooGenericExceptionThrownRule detects throwing Exception/Throwable. ---------------------------------------------------------------------------

func (*TooGenericExceptionThrownRule) Confidence

func (r *TooGenericExceptionThrownRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — matches on thrown-exception names; name-only fallback false-positives on project-defined exceptions with the same name. Classified per roadmap/17.

func (*TooGenericExceptionThrownRule) Meta

type TooManyFunctionsRule

type TooManyFunctionsRule struct {
	FlatDispatchBase
	BaseRule
	AllowedFunctionsPerFile      int
	AllowedFunctionsPerClass     int
	AllowedFunctionsPerInterface int
	AllowedFunctionsPerObject    int
	AllowedFunctionsPerEnum      int
	IgnorePrivate                bool
	IgnoreDeprecated             bool
	IgnoreInternal               bool
	IgnoreOverridden             bool
}

TooManyFunctionsRule detects files or classes with too many functions.

func (*TooManyFunctionsRule) Confidence

func (r *TooManyFunctionsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This rule uses a threshold-based metric (line count, nesting depth, branch count, parameter count, etc.) against a configurable limit. The counting is structurally precise but the threshold is a style preference that varies by codebase — a given value may be conservative in some contexts and lax in others. Classified per roadmap/17.

func (*TooManyFunctionsRule) Meta

type TooManyViewsResourceRule

type TooManyViewsResourceRule struct {
	LayoutResourceBase
	AndroidRule
	MaxViews int // default 80
}

TooManyViewsResourceRule detects layouts that exceed a view count threshold. Large layouts are slow to inflate and increase memory usage.

func (*TooManyViewsResourceRule) Confidence

func (r *TooManyViewsResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*TooManyViewsResourceRule) Meta

type TopLevelPropertyNamingRule

type TopLevelPropertyNamingRule struct {
	FlatDispatchBase
	BaseRule
	ConstPattern           *regexp.Regexp
	PropertyPattern        *regexp.Regexp
	PrivatePropertyPattern *regexp.Regexp
}

TopLevelPropertyNamingRule checks top-level property names.

func (*TopLevelPropertyNamingRule) Confidence

func (r *TopLevelPropertyNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*TopLevelPropertyNamingRule) Meta

type TraceIDLoggedAsPlainMessageRule

type TraceIDLoggedAsPlainMessageRule struct {
	FlatDispatchBase
	BaseRule

	Identifiers []string
}

TraceIDLoggedAsPlainMessageRule detects trace/span/request/correlation IDs embedded directly in log message text instead of being carried in MDC or a structured logging field.

func (*TraceIDLoggedAsPlainMessageRule) Confidence

func (r *TraceIDLoggedAsPlainMessageRule) Confidence() float64

func (*TraceIDLoggedAsPlainMessageRule) Meta

type TrailingWhitespaceRule

type TrailingWhitespaceRule struct {
	LineBase
	BaseRule
}

TrailingWhitespaceRule detects lines ending with spaces or tabs.

func (*TrailingWhitespaceRule) Confidence

func (r *TrailingWhitespaceRule) Confidence() float64

Confidence bumps this line rule from the 0.75 line-rule default to 0.95 — trailing whitespace is a pure lexical condition with no known false positives.

func (*TrailingWhitespaceRule) IsFixable

func (r *TrailingWhitespaceRule) IsFixable() bool

New fixable rules

func (*TrailingWhitespaceRule) Meta

type TranslatableMarkupMismatchRule

type TranslatableMarkupMismatchRule struct {
	ValuesStringsResourceBase
	AndroidRule
}

TranslatableMarkupMismatchRule flags <string> resources whose markup style differs across locale variants — e.g. the default uses HTML markup like <b>bold</b> while a translated variant uses Markdown (**bold**) or plain text (or vice versa).

func (*TranslatableMarkupMismatchRule) Confidence

func (r *TranslatableMarkupMismatchRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Markup detection is regex-based; literal `**` or `<b ` lookalikes in translator text can occasionally produce false positives.

type TrimMultilineRawStringRule

type TrimMultilineRawStringRule struct {
	FlatDispatchBase
	BaseRule
	TrimmingMethods []string
}

TrimMultilineRawStringRule detects raw strings missing trimIndent/trimMargin.

func (*TrimMultilineRawStringRule) Confidence

func (r *TrimMultilineRawStringRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/expression rule. Detection uses structural pattern matching on expressions; the suggested rewrite's readability is a style call. Classified per roadmap/17.

func (*TrimMultilineRawStringRule) IsFixable

func (r *TrimMultilineRawStringRule) IsFixable() bool

func (*TrimMultilineRawStringRule) Meta

type TrulyRandomRule

type TrulyRandomRule struct {
	LineBase
	AndroidRule
}

func (*TrulyRandomRule) Confidence

func (r *TrulyRandomRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*TrulyRandomRule) Meta

type TrustedServerRule

type TrustedServerRule struct{ AndroidRule }

TrustedServerRule detects trust-all certificate patterns.

func (*TrustedServerRule) Confidence

func (r *TrustedServerRule) Confidence() float64

Confidence bumps this rule to tier-1 (high). The AST dispatch inspects class/object declarations for X509TrustManager supertypes with empty override bodies, and matches a short allow-list of known trust-all hostname-verifier identifiers. Both paths avoid the comment/string false positives that the previous line scan was prone to.

func (*TrustedServerRule) Meta

type UnconditionalJumpStatementInLoopRule

type UnconditionalJumpStatementInLoopRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- UnconditionalJumpStatementInLoopRule detects loop with unconditional return/break. ---------------------------------------------------------------------------

func (*UnconditionalJumpStatementInLoopRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Potential-bugs properties rule. Detection is structural with heuristic fallbacks for flow-dependent cases. Classified per roadmap/17.

func (*UnconditionalJumpStatementInLoopRule) Meta

type UnderscoresInNumericLiteralsRule

type UnderscoresInNumericLiteralsRule struct {
	FlatDispatchBase
	BaseRule
	AcceptableLength         int // maximum consecutive digits allowed without underscores
	AllowNonStandardGrouping bool
}

UnderscoresInNumericLiteralsRule detects large numbers without underscores.

func (*UnderscoresInNumericLiteralsRule) Confidence

func (r *UnderscoresInNumericLiteralsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/formatting rule. Detection is pattern or regex based on line text; deterministic byte checks have been promoted to tier-1 separately. Classified per roadmap/17.

func (*UnderscoresInNumericLiteralsRule) IsFixable

func (r *UnderscoresInNumericLiteralsRule) IsFixable() bool

func (*UnderscoresInNumericLiteralsRule) Meta

type UndocumentedPublicClassRule

type UndocumentedPublicClassRule struct {
	FlatDispatchBase
	BaseRule
	SearchInNestedClass    bool
	SearchInInnerClass     bool
	SearchInInnerObject    bool
	SearchInInnerInterface bool
}

UndocumentedPublicClassRule detects public classes without KDoc.

func (*UndocumentedPublicClassRule) Confidence

func (r *UndocumentedPublicClassRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*UndocumentedPublicClassRule) Meta

type UndocumentedPublicFunctionRule

type UndocumentedPublicFunctionRule struct {
	FlatDispatchBase
	BaseRule
}

UndocumentedPublicFunctionRule detects public functions without KDoc.

func (*UndocumentedPublicFunctionRule) Confidence

func (r *UndocumentedPublicFunctionRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*UndocumentedPublicFunctionRule) Meta

type UndocumentedPublicPropertyRule

type UndocumentedPublicPropertyRule struct {
	FlatDispatchBase
	BaseRule
}

UndocumentedPublicPropertyRule detects public properties without KDoc.

func (*UndocumentedPublicPropertyRule) Confidence

func (r *UndocumentedPublicPropertyRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Documentation/comment rule. Detection checks presence and well-formedness of doc comments on declarations — purely structural. No heuristic path. Classified per roadmap/17.

func (*UndocumentedPublicPropertyRule) Meta

type UnicodeNormalizationMissingRule

type UnicodeNormalizationMissingRule struct {
	FlatDispatchBase
	BaseRule
}

UnicodeNormalizationMissingRule flags `.contains(...)` calls inside search/find functions that have not normalized either operand. Unicode equivalent characters (precomposed vs. decomposed) compare unequal at the code-point level, so a search over user-supplied text without `Normalizer.normalize` will silently miss matches.

func (*UnicodeNormalizationMissingRule) Confidence

func (r *UnicodeNormalizationMissingRule) Confidence() float64

Confidence reports a tier-3 (low) base confidence. The rule cannot resolve the receiver type, so a `List<T>.contains` inside a search function may match. The default-inactive setting compensates.

type UniqueConstantsRule

type UniqueConstantsRule struct {
	FlatDispatchBase
	AndroidRule
}

UniqueConstantsRule detects duplicate annotation constant values.

func (*UniqueConstantsRule) Confidence

func (r *UniqueConstantsRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*UniqueConstantsRule) Meta

type UniquePermissionRule

type UniquePermissionRule struct {
	ManifestBase
	AndroidRule
}

UniquePermissionRule checks that custom permission names don't collide with well-known system permission names.

func (*UniquePermissionRule) Meta

type UnknownIDInLayoutRule

type UnknownIDInLayoutRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*UnknownIDInLayoutRule) Confidence

func (r *UnknownIDInLayoutRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*UnknownIDInLayoutRule) Meta

type UnnamedParameterUseRule

type UnnamedParameterUseRule struct {
	FlatDispatchBase
	BaseRule
	AllowSingleParamUse bool
}

--------------------------------------------------------------------------- UnnamedParameterUseRule detects function calls with many unnamed params. ---------------------------------------------------------------------------

func (*UnnamedParameterUseRule) Confidence

func (r *UnnamedParameterUseRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs properties rule. Detection is structural with heuristic fallbacks for flow-dependent cases. Classified per roadmap/17.

func (*UnnamedParameterUseRule) Meta

type UnnecessaryAnyRule

type UnnecessaryAnyRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryAnyRule detects unnecessary .any { true }, .any { it }, and .none { true } calls that can be replaced with .isNotEmpty() or .isEmpty(). Also detects .filter { pred }.any() which should be .any { pred }.

func (*UnnecessaryAnyRule) IsFixable

func (r *UnnecessaryAnyRule) IsFixable() bool

func (*UnnecessaryAnyRule) Meta

type UnnecessaryApplyRule

type UnnecessaryApplyRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryApplyRule detects `.apply {}` where the lambda body never references the receiver (empty body, or body that only uses external references without any implicit/explicit `this` access).

func (*UnnecessaryApplyRule) IsFixable

func (r *UnnecessaryApplyRule) IsFixable() bool

func (*UnnecessaryApplyRule) Meta

type UnnecessaryBackticksRule

type UnnecessaryBackticksRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryBackticksRule detects unnecessary backtick-quoted identifiers.

func (*UnnecessaryBackticksRule) Confidence

func (r *UnnecessaryBackticksRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/redundant rule. Detection flags visible but arguably-redundant modifiers, types, or keywords. Whether removal improves readability is context-dependent. Classified per roadmap/17.

func (*UnnecessaryBackticksRule) IsFixable

func (r *UnnecessaryBackticksRule) IsFixable() bool

func (*UnnecessaryBackticksRule) Meta

type UnnecessaryBracesAroundTrailingLambdaRule

type UnnecessaryBracesAroundTrailingLambdaRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryBracesAroundTrailingLambdaRule detects unnecessary parentheses around trailing lambdas. Pattern: `foo() { lambda }` should be `foo { lambda }`.

func (*UnnecessaryBracesAroundTrailingLambdaRule) IsFixable

func (*UnnecessaryBracesAroundTrailingLambdaRule) Meta

type UnnecessaryFilterRule

type UnnecessaryFilterRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryFilterRule detects .filter { pred }.first() patterns that can be simplified to .first { pred }. Covers first, firstOrNull, last, lastOrNull, single, singleOrNull, count, any, none, and property-access forms (size, isEmpty, isNotEmpty).

func (*UnnecessaryFilterRule) IsFixable

func (r *UnnecessaryFilterRule) IsFixable() bool

func (*UnnecessaryFilterRule) Meta

type UnnecessaryFullyQualifiedNameRule

type UnnecessaryFullyQualifiedNameRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryFullyQualifiedNameRule detects fully qualified names that have a matching import.

func (*UnnecessaryFullyQualifiedNameRule) IsFixable

func (r *UnnecessaryFullyQualifiedNameRule) IsFixable() bool

UnnecessaryFullyQualifiedName: removing the FQN prefix requires ensuring an import already exists or adding one — the rule currently just reports. Not fixable until the import-management helper lands.

func (*UnnecessaryFullyQualifiedNameRule) Meta

type UnnecessaryInheritanceRule

type UnnecessaryInheritanceRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryInheritanceRule detects `: Any()`.

func (*UnnecessaryInheritanceRule) Confidence

func (r *UnnecessaryInheritanceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/redundant rule. Detection flags visible but arguably-redundant modifiers, types, or keywords. Whether removal improves readability is context-dependent. Classified per roadmap/17.

func (*UnnecessaryInheritanceRule) IsFixable

func (r *UnnecessaryInheritanceRule) IsFixable() bool

func (*UnnecessaryInheritanceRule) Meta

type UnnecessaryInitOnArrayRule

type UnnecessaryInitOnArrayRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryInitOnArrayRule detects IntArray(n) { 0 }, etc. where init value is the default.

func (*UnnecessaryInitOnArrayRule) Confidence

func (r *UnnecessaryInitOnArrayRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule now inspects only array-constructor call expressions and single-expression init lambdas; confidence remains medium because the constructor target may be unresolved in parser-only runs.

func (*UnnecessaryInitOnArrayRule) IsFixable

func (r *UnnecessaryInitOnArrayRule) IsFixable() bool

func (*UnnecessaryInitOnArrayRule) Meta

type UnnecessaryInnerClassRule

type UnnecessaryInnerClassRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryInnerClassRule detects inner classes that don't use the outer reference.

func (*UnnecessaryInnerClassRule) Confidence

func (r *UnnecessaryInnerClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/redundant rule. Detection flags visible but arguably-redundant modifiers, types, or keywords. Whether removal improves readability is context-dependent. Classified per roadmap/17.

func (*UnnecessaryInnerClassRule) IsFixable

func (r *UnnecessaryInnerClassRule) IsFixable() bool

func (*UnnecessaryInnerClassRule) Meta

type UnnecessaryLetRule

type UnnecessaryLetRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryLetRule detects unnecessary .let {} calls via AST dispatch. Flags two patterns:

  1. Identity let: `x?.let { it }` \u2014 the value can be used directly.
  2. Single-call let: `x.let { it.foo() }` \u2014 can be replaced with `x.foo()`.

func (*UnnecessaryLetRule) IsFixable

func (r *UnnecessaryLetRule) IsFixable() bool

func (*UnnecessaryLetRule) Meta

type UnnecessaryNotNullCheckRule

type UnnecessaryNotNullCheckRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- UnnecessaryNotNullCheckRule detects != null on non-nullable. ---------------------------------------------------------------------------

func (*UnnecessaryNotNullCheckRule) Confidence

func (r *UnnecessaryNotNullCheckRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs null safety rule. Detection leans on structural patterns around nullable expressions and has a heuristic fallback when the resolver is absent. Classified per roadmap/17.

func (*UnnecessaryNotNullCheckRule) IsFixable

func (r *UnnecessaryNotNullCheckRule) IsFixable() bool

func (*UnnecessaryNotNullCheckRule) Meta

type UnnecessaryNotNullOperatorRule

type UnnecessaryNotNullOperatorRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- UnnecessaryNotNullOperatorRule detects !! on non-null. ---------------------------------------------------------------------------

func (*UnnecessaryNotNullOperatorRule) Confidence

func (r *UnnecessaryNotNullOperatorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — flags !! on a non-null type; relies on resolver for nullability. Heuristic fallback is conservative but noisy. Classified per roadmap/17.

func (*UnnecessaryNotNullOperatorRule) ExpressionPositions

func (r *UnnecessaryNotNullOperatorRule) ExpressionPositions(file *scanner.File) []uint32

ExpressionPositions enumerates `postfix_expression` nodes whose text ends with `!!` and whose operand is a bare identifier. Those are the positions the rule's check method passes to ResolveByNameFlat — and therefore the only positions where a resolved oracle expression fact would change the verdict.

Used by the targeted-resolution pre-pass under --depth=thorough: the dispatcher batches the union of these positions across active rules, sends one resolveExpressionTypes RPC, and populates the oracle's expressions map before dispatch begins. Lambda-param `!!` is the pattern that lights up here: source inference can't type the param, KAA can.

Mirrors the lexical gates inside check (postfix + `!!` + simple identifier) so the resolution set is tight; over-approximating would still be correct but waste KAA work.

func (*UnnecessaryNotNullOperatorRule) IsFixable

func (r *UnnecessaryNotNullOperatorRule) IsFixable() bool

func (*UnnecessaryNotNullOperatorRule) Meta

type UnnecessaryParenthesesRule

type UnnecessaryParenthesesRule struct {
	FlatDispatchBase
	BaseRule
	AllowForUnclearPrecedence bool // if true, allow parens that clarify operator precedence
}

UnnecessaryParenthesesRule detects unnecessary parentheses around expressions: return values, if/when conditions, assignments, double-wrapped parens, and other contexts where the parentheses add no value.

func (*UnnecessaryParenthesesRule) Confidence

func (r *UnnecessaryParenthesesRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/redundant rule. Detection flags visible but arguably-redundant modifiers, types, or keywords. Whether removal improves readability is context-dependent. Classified per roadmap/17.

func (*UnnecessaryParenthesesRule) IsFixable

func (r *UnnecessaryParenthesesRule) IsFixable() bool

func (*UnnecessaryParenthesesRule) Meta

type UnnecessaryPartOfBinaryExpressionRule

type UnnecessaryPartOfBinaryExpressionRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryPartOfBinaryExpressionRule detects x && true, x || false, etc.

func (*UnnecessaryPartOfBinaryExpressionRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Performance rule. Detection pattern-matches anti-patterns (allocation in loops, primitive boxing, collection chains) with optional resolver support; fallback is heuristic. Classified per roadmap/17.

func (*UnnecessaryPartOfBinaryExpressionRule) IsFixable

Performance rules

func (*UnnecessaryPartOfBinaryExpressionRule) Meta

type UnnecessaryReversedRule

type UnnecessaryReversedRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryReversedRule detects chained sort+reverse (or reverse+sort) patterns that can be replaced by a single sort call. Examples:

.sorted().reversed()             -> .sortedDescending()
.sortedDescending().reversed()   -> .sorted()
.sortedBy{}.reversed()           -> .sortedByDescending{}
.sortedByDescending{}.reversed() -> .sortedBy{}
.reversed().sorted()             -> .sortedDescending()

Also detects asReversed() in place of reversed().

func (*UnnecessaryReversedRule) IsFixable

func (r *UnnecessaryReversedRule) IsFixable() bool

func (*UnnecessaryReversedRule) Meta

type UnnecessarySafeCallRule

type UnnecessarySafeCallRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- UnnecessarySafeCallRule detects ?. on non-null. ---------------------------------------------------------------------------

func (*UnnecessarySafeCallRule) Confidence

func (r *UnnecessarySafeCallRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — flags ?. on a non-null receiver; needs resolver for nullability, falls back to name-based heuristic. Classified per roadmap/17.

func (*UnnecessarySafeCallRule) IsFixable

func (r *UnnecessarySafeCallRule) IsFixable() bool

func (*UnnecessarySafeCallRule) Meta

type UnnecessaryTemporaryInstantiationRule

type UnnecessaryTemporaryInstantiationRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryTemporaryInstantiationRule detects Integer.valueOf(x).toString() etc.

func (*UnnecessaryTemporaryInstantiationRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Performance rule. Detection pattern-matches anti-patterns (allocation in loops, primitive boxing, collection chains) with optional resolver support; fallback is heuristic. Classified per roadmap/17.

func (*UnnecessaryTemporaryInstantiationRule) IsFixable

func (*UnnecessaryTemporaryInstantiationRule) Meta

type UnnecessaryTypeCastingRule

type UnnecessaryTypeCastingRule struct {
	FlatDispatchBase
	BaseRule
}

UnnecessaryTypeCastingRule detects casting a value to its own type.

func (*UnnecessaryTypeCastingRule) Confidence

func (r *UnnecessaryTypeCastingRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — flags casts that are no-ops; needs the resolver to confirm the source type matches the target, falls back to textual comparison. Classified per roadmap/17.

func (*UnnecessaryTypeCastingRule) IsFixable

func (r *UnnecessaryTypeCastingRule) IsFixable() bool

Performance fixable rules (batch 3)

func (*UnnecessaryTypeCastingRule) Meta

type UnpackedNativeCodeManifestRule

type UnpackedNativeCodeManifestRule struct {
	ManifestBase
	AndroidRule
}

UnpackedNativeCodeManifestRule detects missing android:extractNativeLibs="false" when native libraries exist. On API 23+ setting this to false reduces APK size and install footprint.

func (*UnpackedNativeCodeManifestRule) Meta

type UnprotectedDynamicReceiverRule

type UnprotectedDynamicReceiverRule struct {
	FlatDispatchBase
	AndroidRule
}

UnprotectedDynamicReceiverRule detects dynamic broadcast receivers registered for public actions without a broadcast permission.

func (*UnprotectedDynamicReceiverRule) Confidence

func (r *UnprotectedDynamicReceiverRule) Confidence() float64

func (*UnprotectedDynamicReceiverRule) Meta

type UnprotectedSMSBroadcastReceiverManifestRule

type UnprotectedSMSBroadcastReceiverManifestRule struct {
	ManifestBase
	AndroidRule
}

UnprotectedSMSBroadcastReceiverManifestRule detects broadcast receivers that listen for SMS_RECEIVED but do not declare android:permission. Without a permission, any app can send fake SMS_RECEIVED broadcasts.

func (*UnprotectedSMSBroadcastReceiverManifestRule) Meta

type UnreachableCatchBlockRule

type UnreachableCatchBlockRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- UnreachableCatchBlockRule detects catch shadowed by general catch above. ---------------------------------------------------------------------------

func (*UnreachableCatchBlockRule) Confidence

func (r *UnreachableCatchBlockRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — catch-block reachability depends on the thrown-type hierarchy from the resolver; heuristic fallback uses name containment. Classified per roadmap/17.

func (*UnreachableCatchBlockRule) Meta

type UnreachableCodeRule

type UnreachableCodeRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- UnreachableCodeRule detects code after return/throw/break/continue, Nothing-returning calls like TODO() and error(), exhaustive when expressions, if expressions where all branches terminate, and infinite loops (while(true)).

When the oracle provides compiler diagnostics (UNREACHABLE_CODE, USELESS_ELVIS), those are used authoritatively — no heuristic false positives.

Limitations of heuristic fallback (without oracle diagnostics):

  • Cannot detect useless elvis (KaFirDiagnostic.UselessElvis)

---------------------------------------------------------------------------

func (*UnreachableCodeRule) Confidence

func (r *UnreachableCodeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. When the oracle provides compiler diagnostics the rule is authoritative (the Kotlin compiler already decided the code is unreachable), but the heuristic fallback walks sibling nodes looking for return/throw/break/continue and can miss cases involving labeled jumps, when-exhaustive-with-Nothing returns, or compiler-intrinsic functions beyond the small nothingReturningFuncs allow-list (TODO, error). Findings produced via the diagnostic path could override to 0.95 per-finding; the rule-level base reflects the fallback's accuracy.

func (*UnreachableCodeRule) IsFixable

func (r *UnreachableCodeRule) IsFixable() bool

func (*UnreachableCodeRule) Meta

type UnsafeCallOnNullableTypeRule

type UnsafeCallOnNullableTypeRule struct {
	FlatDispatchBase
	BaseRule
	CustomPreviewWildcard bool
	CustomPreviewPrefixes []string
}

--------------------------------------------------------------------------- UnsafeCallOnNullableTypeRule detects !! operator usage. ---------------------------------------------------------------------------

func (*UnsafeCallOnNullableTypeRule) Meta

type UnsafeCastRule

type UnsafeCastRule struct {
	FlatDispatchBase
	BaseRule
	CustomPreviewWildcard bool
	CustomPreviewPrefixes []string
}

--------------------------------------------------------------------------- UnsafeCastRule detects casts that cannot ever succeed.

The authoritative path consumes Kotlin compiler diagnostics from the oracle (CAST_NEVER_SUCCEEDS). Without compiler diagnostics, the fallback only emits when the local resolver proves both source and target are final, disjoint types. ---------------------------------------------------------------------------

func (*UnsafeCastRule) Confidence

func (r *UnsafeCastRule) Confidence() float64

Confidence reports a tier-1 base confidence. The oracle-backed path mirrors the Kotlin compiler's CAST_NEVER_SUCCEEDS diagnostic; the non-oracle fallback is intentionally limited to final, disjoint types.

func (*UnsafeCastRule) IsFixable

func (r *UnsafeCastRule) IsFixable() bool

Potential-bugs rules

func (*UnsafeCastRule) Meta

func (r *UnsafeCastRule) Meta() api.RuleDescriptor

type UnsafeProtectedBroadcastReceiverManifestRule

type UnsafeProtectedBroadcastReceiverManifestRule struct {
	ManifestBase
	AndroidRule
}

UnsafeProtectedBroadcastReceiverManifestRule detects receivers listening for protected broadcast actions (e.g., BOOT_COMPLETED) that are exported without a permission. Protected broadcasts should still require a permission guard.

func (*UnsafeProtectedBroadcastReceiverManifestRule) Meta

type UnstructuredErrorLogRule

type UnstructuredErrorLogRule struct {
	FlatDispatchBase
	BaseRule

	Methods []string
}

UnstructuredErrorLogRule detects logger.error/logger.warn calls that embed a Throwable-looking value in the message instead of passing it as a structured throwable argument.

func (*UnstructuredErrorLogRule) Confidence

func (r *UnstructuredErrorLogRule) Confidence() float64

func (*UnstructuredErrorLogRule) Meta

type UnsupportedChromeOsHardwareManifestRule

type UnsupportedChromeOsHardwareManifestRule struct {
	ManifestBase
	AndroidRule
}

UnsupportedChromeOsHardwareManifestRule detects <uses-feature> declarations for hardware features unsupported on Chrome OS (e.g., telephony, camera) that are not marked with android:required="false". This prevents the app from being available on Chromebooks.

func (*UnsupportedChromeOsHardwareManifestRule) Meta

type UntestedPublicAPIRule

type UntestedPublicAPIRule struct {
	BaseRule
}

func (*UntestedPublicAPIRule) Confidence

func (r *UntestedPublicAPIRule) Confidence() float64

func (*UntestedPublicAPIRule) Meta

type UnusedAttributeResourceRule

type UnusedAttributeResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

UnusedAttributeResourceRule detects layout attributes that require a minimum API level. These attributes are silently ignored on older platforms.

func (*UnusedAttributeResourceRule) Confidence

func (r *UnusedAttributeResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*UnusedAttributeResourceRule) Meta

type UnusedImportRule

type UnusedImportRule struct {
	FlatDispatchBase
	BaseRule
}

UnusedImportRule detects import statements where the imported name is not used.

func (*UnusedImportRule) Confidence

func (r *UnusedImportRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/unused rule. Detection uses a structural per-file reference-name index, but it does not fully resolve ambiguous imports.

func (*UnusedImportRule) IsFixable

func (r *UnusedImportRule) IsFixable() bool

func (*UnusedImportRule) Meta

type UnusedNamespaceResourceRule

type UnusedNamespaceResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

UnusedNamespaceResourceRule detects xmlns namespace declarations on the root view that are never used by any attribute in the layout tree.

func (*UnusedNamespaceResourceRule) Confidence

func (r *UnusedNamespaceResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*UnusedNamespaceResourceRule) Meta

type UnusedParameterRule

type UnusedParameterRule struct {
	FlatDispatchBase
	BaseRule
	AllowedNames *regexp.Regexp
}

UnusedParameterRule detects function parameters that are never used in the body.

func (*UnusedParameterRule) Confidence

func (r *UnusedParameterRule) Confidence() float64

Confidence reports a tier-1 (high) base confidence. Parameter usage is detected from reference-shaped AST identifiers with local shadowing handled structurally, so comments, strings, and substring collisions do not count as usage.

func (*UnusedParameterRule) IsFixable

func (r *UnusedParameterRule) IsFixable() bool

func (*UnusedParameterRule) Meta

type UnusedPrivateClassRule

type UnusedPrivateClassRule struct {
	FlatDispatchBase
	BaseRule
}

UnusedPrivateClassRule detects private classes that are never referenced.

func (*UnusedPrivateClassRule) Confidence

func (r *UnusedPrivateClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/unused rule. Detection uses substring presence in the enclosing scope body to decide whether a declaration is referenced, which false-positives on substring collisions. Classified per roadmap/17.

func (*UnusedPrivateClassRule) IsFixable

func (r *UnusedPrivateClassRule) IsFixable() bool

func (*UnusedPrivateClassRule) Meta

type UnusedPrivateFunctionRule

type UnusedPrivateFunctionRule struct {
	FlatDispatchBase
	BaseRule
	AllowedNames *regexp.Regexp
}

UnusedPrivateFunctionRule detects private functions that are never called.

func (*UnusedPrivateFunctionRule) Confidence

func (r *UnusedPrivateFunctionRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/unused rule. Detection uses substring presence in the enclosing scope body to decide whether a declaration is referenced, which false-positives on substring collisions. Classified per roadmap/17.

func (*UnusedPrivateFunctionRule) IsFixable

func (r *UnusedPrivateFunctionRule) IsFixable() bool

func (*UnusedPrivateFunctionRule) Meta

type UnusedPrivateMemberRule

type UnusedPrivateMemberRule struct {
	FlatDispatchBase
	BaseRule
	AllowedNames    *regexp.Regexp
	IgnoreAnnotated []string
}

UnusedPrivateMemberRule is a combined check for unused private members.

func (*UnusedPrivateMemberRule) Confidence

func (r *UnusedPrivateMemberRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/unused rule. Detection uses substring presence in the enclosing scope body to decide whether a declaration is referenced, which false-positives on substring collisions. Classified per roadmap/17.

func (*UnusedPrivateMemberRule) IsFixable

func (r *UnusedPrivateMemberRule) IsFixable() bool

func (*UnusedPrivateMemberRule) Meta

type UnusedPrivatePropertyRule

type UnusedPrivatePropertyRule struct {
	FlatDispatchBase
	BaseRule
	AllowedNames *regexp.Regexp
}

UnusedPrivatePropertyRule detects private properties that are never referenced.

func (*UnusedPrivatePropertyRule) Confidence

func (r *UnusedPrivatePropertyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/unused rule. Detection uses substring presence in the enclosing scope body to decide whether a declaration is referenced, which false-positives on substring collisions. Classified per roadmap/17.

func (*UnusedPrivatePropertyRule) IsFixable

func (r *UnusedPrivatePropertyRule) IsFixable() bool

func (*UnusedPrivatePropertyRule) Meta

type UnusedQuantityResourceRule

type UnusedQuantityResourceRule struct {
	ValuesPluralsResourceBase
	AndroidRule
}

UnusedQuantityResourceRule detects plural quantities that are unnecessary for the default language (English). For English, "zero", "two", "few", and "many" are not used by the plural rules and will never be selected at runtime.

func (*UnusedQuantityResourceRule) Confidence

func (r *UnusedQuantityResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*UnusedQuantityResourceRule) Meta

type UnusedResourcesRule

type UnusedResourcesRule struct {
	FlatDispatchBase
	AndroidRule
}

UnusedResourcesRule flags references to R.string, R.drawable, R.layout resources whose names follow common "temp" or "test" patterns (test_, temp_, unused_, old_). Full unused-resource detection requires cross-file analysis; this is a light heuristic.

func (*UnusedResourcesRule) Confidence

func (r *UnusedResourcesRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*UnusedResourcesRule) Meta

type UnusedUnaryOperatorRule

type UnusedUnaryOperatorRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- UnusedUnaryOperatorRule detects standalone +x or -x as expression statements whose result is never used. This catches the common bug where a line like `+ 3` appears to continue a previous expression but is actually parsed as a separate unary prefix expression with no effect. ---------------------------------------------------------------------------

func (*UnusedUnaryOperatorRule) Confidence

func (r *UnusedUnaryOperatorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Potential-bugs properties rule. Detection is structural with heuristic fallbacks for flow-dependent cases. Classified per roadmap/17.

func (*UnusedUnaryOperatorRule) Meta

type UnusedVariableRule

type UnusedVariableRule struct {
	FlatDispatchBase
	BaseRule
	AllowedNames *regexp.Regexp
}

UnusedVariableRule detects local variables that are never used.

func (*UnusedVariableRule) Confidence

func (r *UnusedVariableRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. The rule uses scope-aware AST reference matching without type inference, so it skips unresolved local cases instead of emitting high-confidence findings.

func (*UnusedVariableRule) IsFixable

func (r *UnusedVariableRule) IsFixable() bool

Style2 — unused rules

Unused-symbol deletions need multi-line span computation (leading KDoc, surrounding blank lines, follow-up comma cleanup in parameter lists) that the current Check() paths don't produce. They're advertised as not-fixable until the deletion pipeline lands. ModifierOrder remains fixable because it's an in-place rewrite of the modifier list with no span work.

func (*UnusedVariableRule) Meta

type UpperLowerInvariantMisuseRule

type UpperLowerInvariantMisuseRule struct {
	FlatDispatchBase
	BaseRule
}

UpperLowerInvariantMisuseRule flags Kotlin 1.5+ `uppercase()` / `lowercase()` calls that omit an explicit Locale argument. Although these methods are locale-invariant (they delegate to Locale.ROOT), passing `Locale.ROOT` explicitly documents intent and prevents accidental confusion with the deprecated default-locale variants (`toUpperCase()` / `toLowerCase()`).

func (*UpperLowerInvariantMisuseRule) Confidence

func (r *UpperLowerInvariantMisuseRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence because the rule matches on method name without type resolution; same-named local helpers will produce false positives.

type UseAlpha2Rule

type UseAlpha2Rule struct {
	LineBase
	AndroidRule
}

func (*UseAlpha2Rule) Meta

func (r *UseAlpha2Rule) Meta() api.RuleDescriptor

type UseAnyOrNoneInsteadOfFindRule

type UseAnyOrNoneInsteadOfFindRule struct {
	FlatDispatchBase
	BaseRule
}

UseAnyOrNoneInsteadOfFindRule detects `.find {} != null` and `.find {} == null` (and also firstOrNull / lastOrNull variants). Uses AST dispatch on equality_expression for precise detection.

func (*UseAnyOrNoneInsteadOfFindRule) Confidence

func (r *UseAnyOrNoneInsteadOfFindRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule. Detection pattern-matches the anti-idiom (if/throw blocks, null checks, explicit loops) but whether the suggested replacement is actually clearer is context-dependent. Classified per roadmap/17.

func (*UseAnyOrNoneInsteadOfFindRule) IsFixable

func (r *UseAnyOrNoneInsteadOfFindRule) IsFixable() bool

func (*UseAnyOrNoneInsteadOfFindRule) Meta

type UseArrayLiteralsInAnnotationsRule

type UseArrayLiteralsInAnnotationsRule struct {
	FlatDispatchBase
	BaseRule
}

func (*UseArrayLiteralsInAnnotationsRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*UseArrayLiteralsInAnnotationsRule) IsFixable

func (r *UseArrayLiteralsInAnnotationsRule) IsFixable() bool

func (*UseArrayLiteralsInAnnotationsRule) Meta

type UseCheckNotNullRule

type UseCheckNotNullRule struct {
	FlatDispatchBase
	BaseRule
}

UseCheckNotNullRule detects check(x != null) and suggests checkNotNull(x). Uses AST dispatch on call_expression for precise detection, handling both `x != null` and `null != x` argument order as the full condition, plus optional message lambdas like `check(x != null) { "msg" }`.

func (*UseCheckNotNullRule) Confidence

func (r *UseCheckNotNullRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — suggests checkNotNull over `if (x == null) throw`; pattern-based with resolver used to confirm nullability when available. Classified per roadmap/17.

func (*UseCheckNotNullRule) IsFixable

func (r *UseCheckNotNullRule) IsFixable() bool

func (*UseCheckNotNullRule) Meta

type UseCheckOrErrorRule

type UseCheckOrErrorRule struct {
	FlatDispatchBase
	BaseRule
}

UseCheckOrErrorRule detects `if (!x) throw IllegalStateException`.

func (*UseCheckOrErrorRule) Confidence

func (r *UseCheckOrErrorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule. Detection pattern-matches the anti-idiom (if/throw blocks, null checks, explicit loops) but whether the suggested replacement is actually clearer is context-dependent. Classified per roadmap/17.

func (*UseCheckOrErrorRule) IsFixable

func (r *UseCheckOrErrorRule) IsFixable() bool

func (*UseCheckOrErrorRule) Meta

type UseCheckPermissionManifestRule

type UseCheckPermissionManifestRule struct {
	ManifestBase
	AndroidRule
}

UseCheckPermissionManifestRule detects exported services that handle sensitive system intent actions (e.g., BIND_ACCESSIBILITY_SERVICE, BIND_INPUT_METHOD) without declaring android:permission. These services are security-sensitive and must restrict access via permissions.

func (*UseCheckPermissionManifestRule) Meta

type UseCompoundDrawablesResourceRule

type UseCompoundDrawablesResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

UseCompoundDrawablesResourceRule detects a LinearLayout with exactly one ImageView and one TextView as children. This pattern can be replaced with a single TextView using compound drawables (drawableLeft, drawableTop, etc.).

func (*UseCompoundDrawablesResourceRule) Confidence

func (r *UseCompoundDrawablesResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*UseCompoundDrawablesResourceRule) Meta

type UseDataClassRule

type UseDataClassRule struct {
	FlatDispatchBase
	BaseRule
	AllowVars bool
}

func (*UseDataClassRule) Confidence

func (r *UseDataClassRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*UseDataClassRule) IsFixable

func (r *UseDataClassRule) IsFixable() bool

UseDataClass: converting a regular class to a data class requires rewriting the primary constructor and dropping equals/hashCode/ toString members; not fixable until the class-rewrite helper lands.

func (*UseDataClassRule) Meta

type UseEmptyCounterpartRule

type UseEmptyCounterpartRule struct {
	FlatDispatchBase
	BaseRule
}

UseEmptyCounterpartRule detects `listOf()` etc. with no arguments. Uses AST dispatch on call_expression for precise detection, matching listOf(), setOf(), mapOf(), arrayOf(), sequenceOf(), and listOfNotNull() with zero arguments, and suggesting emptyList(), emptySet(), etc.

func (*UseEmptyCounterpartRule) Confidence

func (r *UseEmptyCounterpartRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule. Detection pattern-matches the anti-idiom (if/throw blocks, null checks, explicit loops) but whether the suggested replacement is actually clearer is context-dependent. Classified per roadmap/17.

func (*UseEmptyCounterpartRule) IsFixable

func (r *UseEmptyCounterpartRule) IsFixable() bool

func (*UseEmptyCounterpartRule) Meta

type UseIfEmptyOrIfBlankRule

type UseIfEmptyOrIfBlankRule struct {
	FlatDispatchBase
	BaseRule
}

func (*UseIfEmptyOrIfBlankRule) Confidence

func (r *UseIfEmptyOrIfBlankRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*UseIfEmptyOrIfBlankRule) IsFixable

func (r *UseIfEmptyOrIfBlankRule) IsFixable() bool

func (*UseIfEmptyOrIfBlankRule) Meta

type UseIfInsteadOfWhenRule

type UseIfInsteadOfWhenRule struct {
	FlatDispatchBase
	BaseRule
	IgnoreWhenContainingVariableDeclaration bool
}

func (*UseIfInsteadOfWhenRule) Confidence

func (r *UseIfInsteadOfWhenRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*UseIfInsteadOfWhenRule) IsFixable

func (r *UseIfInsteadOfWhenRule) IsFixable() bool

UseIfInsteadOfWhen: rewrites no-subject `when` expressions with up to two single-condition entries into the equivalent `if`/`if-else`. The subject form and multi-condition entries are left untouched because their rewrite would require synthesizing comparison operators whose semantics depend on the entry kind.

func (*UseIfInsteadOfWhenRule) Meta

type UseIsNullOrEmptyRule

type UseIsNullOrEmptyRule struct {
	FlatDispatchBase
	BaseRule
}

UseIsNullOrEmptyRule detects `x == null || x.isEmpty()` and related patterns such as `x == null || x.count() == 0`, `x == null || x.size == 0`, `x == null || x.length == 0`, and `x == null || x == ""`. Uses tree-sitter DispatchRule on disjunction_expression for structural accuracy.

func (*UseIsNullOrEmptyRule) Confidence

func (r *UseIsNullOrEmptyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — suggests isNullOrEmpty() for `x == null || x.isEmpty()` after semantic receiver checks, with lower-confidence same-file declaration fallback. Classified per roadmap/17.

func (*UseIsNullOrEmptyRule) IsFixable

func (r *UseIsNullOrEmptyRule) IsFixable() bool

func (*UseIsNullOrEmptyRule) Meta

type UseLetRule

type UseLetRule struct {
	FlatDispatchBase
	BaseRule
}

func (*UseLetRule) Confidence

func (r *UseLetRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*UseLetRule) IsFixable

func (r *UseLetRule) IsFixable() bool

UseLet: wrapping a block in `.let { }` is a structure rewrite that needs to pick an identifier and adjust the body — not fixable until the rewrite helper lands.

func (*UseLetRule) Meta

func (r *UseLetRule) Meta() api.RuleDescriptor

type UseOrEmptyRule

type UseOrEmptyRule struct {
	FlatDispatchBase
	BaseRule
}

UseOrEmptyRule detects `x ?: emptyList()` and similar patterns that can use .orEmpty(). Handles: emptyList/Set/Map/Array/Sequence(), listOf/setOf/mapOf/sequenceOf/arrayOf() with no arguments, and empty string literals ("" / """"""). Uses tree-sitter DispatchRule on elvis_expression for structural accuracy.

func (*UseOrEmptyRule) Confidence

func (r *UseOrEmptyRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule. Detection pattern-matches the anti-idiom (if/throw blocks, null checks, explicit loops) but whether the suggested replacement is actually clearer is context-dependent. Classified per roadmap/17.

func (*UseOrEmptyRule) IsFixable

func (r *UseOrEmptyRule) IsFixable() bool

func (*UseOrEmptyRule) Meta

func (r *UseOrEmptyRule) Meta() api.RuleDescriptor

type UseRequireNotNullRule

type UseRequireNotNullRule struct {
	FlatDispatchBase
	BaseRule
}

UseRequireNotNullRule detects require(x != null) and suggests requireNotNull(x). Uses AST dispatch on call_expression for precise detection, handling both `x != null` and `null != x` argument order as the full condition, plus optional message lambdas like `require(x != null) { "msg" }`.

func (*UseRequireNotNullRule) Confidence

func (r *UseRequireNotNullRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — suggests requireNotNull over `if (x == null) throw IAE`; pattern-based with resolver confirmation when available. Classified per roadmap/17.

func (*UseRequireNotNullRule) IsFixable

func (r *UseRequireNotNullRule) IsFixable() bool

func (*UseRequireNotNullRule) Meta

type UseRequireRule

type UseRequireRule struct {
	FlatDispatchBase
	BaseRule
}

UseRequireRule detects `if (!x) throw IllegalArgumentException`.

func (*UseRequireRule) Confidence

func (r *UseRequireRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule. Detection pattern-matches the anti-idiom (if/throw blocks, null checks, explicit loops) but whether the suggested replacement is actually clearer is context-dependent. Classified per roadmap/17.

func (*UseRequireRule) IsFixable

func (r *UseRequireRule) IsFixable() bool

func (*UseRequireRule) Meta

func (r *UseRequireRule) Meta() api.RuleDescriptor

type UseSumOfInsteadOfFlatMapSizeRule

type UseSumOfInsteadOfFlatMapSizeRule struct {
	FlatDispatchBase
	BaseRule
}

func (*UseSumOfInsteadOfFlatMapSizeRule) Confidence

func (r *UseSumOfInsteadOfFlatMapSizeRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/idiomatic rule for collection and data-flow idioms. The detection is pattern-based and the suggested replacement's readability is a style preference. Classified per roadmap/17.

func (*UseSumOfInsteadOfFlatMapSizeRule) IsFixable

func (r *UseSumOfInsteadOfFlatMapSizeRule) IsFixable() bool

func (*UseSumOfInsteadOfFlatMapSizeRule) Meta

type UseValueOfRule

type UseValueOfRule struct {
	FlatDispatchBase
	AndroidRule
}

UseValueOfRule flags direct constructor calls for boxed primitive types (e.g., Integer(42), Boolean(true)) where valueOf() should be used instead for object reuse.

func (*UseValueOfRule) Confidence

func (r *UseValueOfRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*UseValueOfRule) Meta

func (r *UseValueOfRule) Meta() api.RuleDescriptor

type UselessCallOnNotNullRule

type UselessCallOnNotNullRule struct {
	FlatDispatchBase
	BaseRule
}

UselessCallOnNotNullRule detects `.orEmpty()`, `.isNullOrEmpty()`, `.isNullOrBlank()` on definitely non-null receivers, and `listOfNotNull()`/`setOfNotNull()` with all non-null arguments.

func (*UselessCallOnNotNullRule) Confidence

func (r *UselessCallOnNotNullRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — flags ?-safe calls on provably non-null receivers; resolver-dependent. Classified per roadmap/17.

func (*UselessCallOnNotNullRule) IsFixable

func (r *UselessCallOnNotNullRule) IsFixable() bool

func (*UselessCallOnNotNullRule) Meta

type UselessLeafResourceRule

type UselessLeafResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

UselessLeafResourceRule detects a leaf ViewGroup (no children, no background, no id) that can be removed.

func (*UselessLeafResourceRule) Confidence

func (r *UselessLeafResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*UselessLeafResourceRule) Meta

type UselessParentResourceRule

type UselessParentResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

UselessParentResourceRule detects a ViewGroup with a single child that has no background, no padding, and no ID — it can be removed and the child promoted.

func (*UselessParentResourceRule) Confidence

func (r *UselessParentResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android layout resource rule. Detection flags layout-file anti-patterns (nesting depth, unnecessary containers, missing constraints) via structural checks on layout XML. Classified per roadmap/17.

func (*UselessParentResourceRule) Meta

type UselessPostfixExpressionRule

type UselessPostfixExpressionRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- UselessPostfixExpressionRule detects `return x++` or `return x--`. ---------------------------------------------------------------------------

func (*UselessPostfixExpressionRule) Confidence

func (r *UselessPostfixExpressionRule) Confidence() float64

Confidence: tier-1 — the rule fires on a jump_expression whose `return` keyword is followed by a postfix_expression over a bare simple_identifier. That shape is unambiguous: the mutation happens after the value is produced, so the increment/decrement has no observable effect. Tree-sitter gives us this shape directly; no text heuristics are involved.

func (*UselessPostfixExpressionRule) IsFixable

func (r *UselessPostfixExpressionRule) IsFixable() bool

func (*UselessPostfixExpressionRule) Meta

type UsesSdkManifestRule

type UsesSdkManifestRule struct {
	ManifestBase
	AndroidRule
}

UsesSdkManifestRule checks for a missing <uses-sdk> element. The manifest should contain a <uses-sdk> element defining the minimum and target API levels.

func (*UsesSdkManifestRule) Meta

type UtilityClassWithPublicConstructorRule

type UtilityClassWithPublicConstructorRule struct {
	FlatDispatchBase
	BaseRule
}

UtilityClassWithPublicConstructorRule detects utility classes with public constructors.

func (*UtilityClassWithPublicConstructorRule) Confidence

Confidence reports a tier-2 (medium) base confidence. Style/classes rule. Detection relies on modifier and declaration structure plus (optional) resolver-backed inheritance checks; the fallback path is heuristic. Classified per roadmap/17.

func (*UtilityClassWithPublicConstructorRule) IsFixable

UtilityClassWithPublicConstructor: autofix landed in item 15 Phase 2c (f3701ab) with two shapes — explicit visibility modifier swap and zero-width " private constructor()" insertion.

func (*UtilityClassWithPublicConstructorRule) Meta

type ValuesArraysResourceBase

type ValuesArraysResourceBase struct{ ResourceBase }

func (ValuesArraysResourceBase) AndroidDependencies

func (ValuesArraysResourceBase) AndroidDependencies() AndroidDataDependency

type ValuesExtraTextResourceBase

type ValuesExtraTextResourceBase struct{ ResourceBase }

func (ValuesExtraTextResourceBase) AndroidDependencies

func (ValuesExtraTextResourceBase) AndroidDependencies() AndroidDataDependency

type ValuesPluralsResourceBase

type ValuesPluralsResourceBase struct{ ResourceBase }

func (ValuesPluralsResourceBase) AndroidDependencies

func (ValuesPluralsResourceBase) AndroidDependencies() AndroidDataDependency

type ValuesResourceBase

type ValuesResourceBase struct{ ResourceBase }

func (ValuesResourceBase) AndroidDependencies

func (ValuesResourceBase) AndroidDependencies() AndroidDataDependency

type ValuesStringsResourceBase

type ValuesStringsResourceBase struct{ ResourceBase }

func (ValuesStringsResourceBase) AndroidDependencies

func (ValuesStringsResourceBase) AndroidDependencies() AndroidDataDependency

type VarCouldBeValRule

type VarCouldBeValRule struct {
	FlatDispatchBase
	BaseRule
	IgnoreLateinitVar bool // if true, skip lateinit var declarations
}

VarCouldBeValRule detects var properties that are never reassigned.

func (*VarCouldBeValRule) Confidence

func (r *VarCouldBeValRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence because this rule uses per-file scope-reassignment tracking instead of full control-flow analysis. It correctly handles the common case (var declared and never reassigned in its enclosing scope) but misses nuances that flow analysis would catch — e.g. vars reassigned only on one branch of a when, or through a captured lambda. Medium confidence reflects the known analysis gap.

func (*VarCouldBeValRule) IsFixable

func (r *VarCouldBeValRule) IsFixable() bool

func (*VarCouldBeValRule) Meta

type VariableMaxLengthRule

type VariableMaxLengthRule struct {
	FlatDispatchBase
	BaseRule
	MaxLength int
}

VariableMaxLengthRule flags variable names that are too long.

func (*VariableMaxLengthRule) Confidence

func (r *VariableMaxLengthRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*VariableMaxLengthRule) Meta

type VariableMinLengthRule

type VariableMinLengthRule struct {
	FlatDispatchBase
	BaseRule
	MinLength int
}

VariableMinLengthRule flags variable names that are too short.

func (*VariableMinLengthRule) Confidence

func (r *VariableMinLengthRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*VariableMinLengthRule) Meta

type VariableNamingRule

type VariableNamingRule struct {
	FlatDispatchBase
	BaseRule
	Pattern                *regexp.Regexp
	PrivateVariablePattern *regexp.Regexp
	ExcludeClassPattern    *regexp.Regexp
}

VariableNamingRule checks local variable names.

func (*VariableNamingRule) Confidence

func (r *VariableNamingRule) Confidence() float64

Confidence holds the 0.95 dispatch default. Naming rule. Detection regex-matches the declared identifier, which is deterministic — the identifier is what it is. No heuristic path. Classified per roadmap/17.

func (*VariableNamingRule) Meta

type VerifyWithoutMockRule

type VerifyWithoutMockRule struct {
	FlatDispatchBase
	BaseRule
}

func (*VerifyWithoutMockRule) Confidence

func (r *VerifyWithoutMockRule) Confidence() float64

func (*VerifyWithoutMockRule) Meta

type VersionCatalogBuildSrcMismatchRule

type VersionCatalogBuildSrcMismatchRule struct {
	BaseRule
}

VersionCatalogBuildSrcMismatchRule flags Gradle dependency coordinates referenced from buildSrc/ or build-logic/ Kotlin sources whose version disagrees with the version pinned in gradle/libs.versions.toml. The catalog is treated as the source of truth.

func (*VersionCatalogBuildSrcMismatchRule) Confidence

func (*VersionCatalogBuildSrcMismatchRule) Meta

func (*VersionCatalogBuildSrcMismatchRule) ModuleAwareNeeds

type VersionCatalogDuplicateVersionRule

type VersionCatalogDuplicateVersionRule struct {
	BaseRule
}

VersionCatalogDuplicateVersionRule flags entries in the [versions] table of gradle/libs.versions.toml whose literal version strings duplicate one another. Two aliases pinned independently to the same value should usually be collapsed into a single named version that the libraries reference via `version.ref` so upgrades stay in lockstep.

func (*VersionCatalogDuplicateVersionRule) Confidence

Confidence is high — duplicate literal version strings are a straightforward textual fact derived from the parsed catalog.

func (*VersionCatalogDuplicateVersionRule) Meta

func (*VersionCatalogDuplicateVersionRule) ModuleAwareNeeds

type VersionCatalogRawVersionInBuildRule

type VersionCatalogRawVersionInBuildRule struct {
	BaseRule
}

VersionCatalogRawVersionInBuildRule flags hardcoded "group:name:version" dependency literals inside Gradle build scripts when the same coordinate is already declared in the project's libs.versions.toml.

func (*VersionCatalogRawVersionInBuildRule) Confidence

func (*VersionCatalogRawVersionInBuildRule) Meta

func (*VersionCatalogRawVersionInBuildRule) ModuleAwareNeeds

type VersionCatalogUnusedRule

type VersionCatalogUnusedRule struct {
	BaseRule
	IgnoredAliases        []string
	ScanConventionPlugins bool
}

VersionCatalogUnusedRule flags aliases declared in gradle/libs.versions.toml that are not referenced from any Gradle build script or convention plugin.

func (*VersionCatalogUnusedRule) Confidence

func (r *VersionCatalogUnusedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence — accessor scanning uses substring match against the dotted accessor form, which is high-recall but can miss exotic reflective uses. The default-inactive policy plus the ignoredAliases escape hatch handle that.

func (*VersionCatalogUnusedRule) Meta

func (*VersionCatalogUnusedRule) ModuleAwareNeeds

func (r *VersionCatalogUnusedRule) ModuleAwareNeeds() ModuleAwareNeeds

type ViewConstructorRule

type ViewConstructorRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ViewConstructorRule) Confidence

func (r *ViewConstructorRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ViewConstructorRule) Meta

type ViewHolderRule

type ViewHolderRule struct {
	FlatDispatchBase
	AndroidRule
}

ViewHolderRule detects RecyclerView.Adapter subclasses that do not implement the ViewHolder pattern (missing ViewHolder or onCreateViewHolder).

func (*ViewHolderRule) Confidence

func (r *ViewHolderRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*ViewHolderRule) Meta

func (r *ViewHolderRule) Meta() api.RuleDescriptor

type ViewTagRule

type ViewTagRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*ViewTagRule) Confidence

func (r *ViewTagRule) Confidence() float64

Confidence reports a high-confidence semantic check. The rule now anchors on setTag call expressions, verifies the receiver is a View, and classifies the tagged value by resolved type instead of variable names.

func (*ViewTagRule) Meta

func (r *ViewTagRule) Meta() api.RuleDescriptor

func (*ViewTagRule) NodeTypes

func (r *ViewTagRule) NodeTypes() []string

type VisibleForTestingCallerInNonTestRule

type VisibleForTestingCallerInNonTestRule struct {
	BaseRule
}

VisibleForTestingCallerInNonTestRule flags calls to @VisibleForTesting functions from non-test files.

func (*VisibleForTestingCallerInNonTestRule) Confidence

func (*VisibleForTestingCallerInNonTestRule) Meta

type VolatileMissingOnDclRule

type VolatileMissingOnDclRule struct {
	FlatDispatchBase
	BaseRule
}

VolatileMissingOnDclRule detects double-checked locking without @Volatile.

func (*VolatileMissingOnDclRule) Confidence

func (r *VolatileMissingOnDclRule) Confidence() float64

func (*VolatileMissingOnDclRule) Meta

type WakelockRule

type WakelockRule struct {
	FlatDispatchBase
	AndroidRule
}

WakelockRule detects WakeLock usage without proper release.

func (*WakelockRule) Confidence

func (r *WakelockRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*WakelockRule) Meta

func (r *WakelockRule) Meta() api.RuleDescriptor

type WeakKeySizeRule

type WeakKeySizeRule struct {
	FlatDispatchBase
	AndroidRule
}

WeakKeySizeRule detects crypto key generators initialized with literal key sizes below conservative per-algorithm thresholds.

func (*WeakKeySizeRule) Confidence

func (r *WeakKeySizeRule) Confidence() float64

func (*WeakKeySizeRule) Meta

type WeakMacAlgorithmRule

type WeakMacAlgorithmRule struct {
	FlatDispatchBase
	AndroidRule
}

WeakMacAlgorithmRule detects Mac.getInstance calls that request HMAC algorithms backed by broken digest functions.

func (*WeakMacAlgorithmRule) Confidence

func (r *WeakMacAlgorithmRule) Confidence() float64

func (*WeakMacAlgorithmRule) Meta

type WeakMessageDigestRule

type WeakMessageDigestRule struct {
	FlatDispatchBase
	AndroidRule
}

WeakMessageDigestRule detects MessageDigest.getInstance calls that request collision-broken digest algorithms.

func (*WeakMessageDigestRule) Confidence

func (r *WeakMessageDigestRule) Confidence() float64

func (*WeakMessageDigestRule) Meta

type WebViewAllowContentAccessRule

type WebViewAllowContentAccessRule struct {
	FlatDispatchBase
	AndroidRule
}

WebViewAllowContentAccessRule flags WebSettings.setAllowContentAccess(true) and the property-assignment equivalent webView.settings.allowContentAccess = true. The content:// URI scheme grants WebView access to content providers; explicit enablement is rarely needed on modern Android and expands the WebView attack surface.

func (*WebViewAllowContentAccessRule) Confidence

func (r *WebViewAllowContentAccessRule) Confidence() float64

func (*WebViewAllowContentAccessRule) Meta

type WebViewAllowFileAccessRule

type WebViewAllowFileAccessRule struct {
	FlatDispatchBase
	AndroidRule
}

WebViewAllowFileAccessRule flags WebSettings.setAllowFileAccess(true) and the property-assignment equivalent webView.settings.allowFileAccess = true. File URL access is disabled by default since API 30; explicit enablement is usually a security mistake.

func (*WebViewAllowFileAccessRule) Confidence

func (r *WebViewAllowFileAccessRule) Confidence() float64

func (*WebViewAllowFileAccessRule) Meta

type WebViewDebuggingEnabledRule

type WebViewDebuggingEnabledRule struct {
	FlatDispatchBase
	AndroidRule
}

WebViewDebuggingEnabledRule flags WebView remote debugging when it is enabled unconditionally in app code.

func (*WebViewDebuggingEnabledRule) Confidence

func (r *WebViewDebuggingEnabledRule) Confidence() float64

func (*WebViewDebuggingEnabledRule) Meta

type WebViewFileAccessFromFileUrlsRule

type WebViewFileAccessFromFileUrlsRule struct {
	FlatDispatchBase
	AndroidRule
}

WebViewFileAccessFromFileUrlsRule flags WebSettings.setAllowFileAccessFromFileURLs(true) and the property-assignment equivalent webView.settings.allowFileAccessFromFileURLs = true. Allowing file:// pages to read other file:// URLs enables a known WebView XSS vector that has been used for local-file exfiltration.

func (*WebViewFileAccessFromFileUrlsRule) Confidence

func (*WebViewFileAccessFromFileUrlsRule) Meta

type WebViewInScrollViewResourceRule

type WebViewInScrollViewResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

WebViewInScrollViewResourceRule detects a WebView placed inside a ScrollView. WebView has its own scrolling and nesting it inside a ScrollView causes broken scroll behavior.

func (*WebViewInScrollViewResourceRule) Confidence

func (r *WebViewInScrollViewResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*WebViewInScrollViewResourceRule) Meta

type WebViewMixedContentAllowAllRule

type WebViewMixedContentAllowAllRule struct {
	FlatDispatchBase
	AndroidRule
}

WebViewMixedContentAllowAllRule flags WebSettings.setMixedContentMode and the property-assignment equivalent webView.settings.mixedContentMode being set to MIXED_CONTENT_ALWAYS_ALLOW (or its int value 0). Allowing all mixed content lets http subresources load on https pages — a TLS-stripping vector.

func (*WebViewMixedContentAllowAllRule) Confidence

func (r *WebViewMixedContentAllowAllRule) Confidence() float64

func (*WebViewMixedContentAllowAllRule) Meta

type WebViewUniversalAccessFromFileUrlsRule

type WebViewUniversalAccessFromFileUrlsRule struct {
	FlatDispatchBase
	AndroidRule
}

WebViewUniversalAccessFromFileUrlsRule flags WebSettings.setAllowUniversalAccessFromFileURLs(true) and the property assignment equivalent webView.settings.allowUniversalAccessFromFileURLs = true. Universal access from file:// URLs lets a page loaded from a local file make cross-origin requests to any domain — one of the most dangerous WebView misconfigurations.

func (*WebViewUniversalAccessFromFileUrlsRule) Confidence

func (*WebViewUniversalAccessFromFileUrlsRule) Meta

type WildcardImportRule

type WildcardImportRule struct {
	FlatDispatchBase
	BaseRule
	ExcludeImports []string // wildcard imports matching these prefixes are allowed
}

WildcardImportRule detects import x.y.* statements.

func (*WildcardImportRule) Confidence

func (r *WildcardImportRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Style/forbidden rule. Detection flags configured forbidden imports/methods/annotations via literal string/regex match; false positives arise when project-local names collide with forbidden list entries. Classified per roadmap/17.

func (*WildcardImportRule) IsFixable

func (r *WildcardImportRule) IsFixable() bool

func (*WildcardImportRule) Meta

type WithContextInSuspendFunctionNoopRule

type WithContextInSuspendFunctionNoopRule struct {
	FlatDispatchBase
	BaseRule
}

WithContextInSuspendFunctionNoopRule detects nested withContext with the same dispatcher.

func (*WithContextInSuspendFunctionNoopRule) Confidence

func (*WithContextInSuspendFunctionNoopRule) Meta

type WithContextWithoutTracingContextRule

type WithContextWithoutTracingContextRule struct {
	FlatDispatchBase
	BaseRule

	AllowedDispatchers []string
}

WithContextWithoutTracingContextRule detects coroutine dispatcher boundary calls made while an OpenTelemetry span is active, but without propagating the tracing context through asContextElement().

func (*WithContextWithoutTracingContextRule) Confidence

func (*WithContextWithoutTracingContextRule) Meta

type WorkManagerNoBackoffRule

type WorkManagerNoBackoffRule struct {
	FlatDispatchBase
	BaseRule
}

WorkManagerNoBackoffRule detects OneTimeWorkRequestBuilder chains without setBackoffCriteria.

func (*WorkManagerNoBackoffRule) Confidence

func (r *WorkManagerNoBackoffRule) Confidence() float64

func (*WorkManagerNoBackoffRule) Meta

type WorkManagerUniquePolicyKeepButReplaceIntendedRule

type WorkManagerUniquePolicyKeepButReplaceIntendedRule struct {
	FlatDispatchBase
	BaseRule
}

WorkManagerUniquePolicyKeepButReplaceIntendedRule detects enqueueUniqueWork with ExistingWorkPolicy.KEEP where REPLACE may be intended.

func (*WorkManagerUniquePolicyKeepButReplaceIntendedRule) Confidence

func (*WorkManagerUniquePolicyKeepButReplaceIntendedRule) Meta

type WorldReadableFilesRule

type WorldReadableFilesRule struct{ AndroidRule }

WorldReadableFilesRule detects MODE_WORLD_READABLE usage.

func (*WorldReadableFilesRule) Confidence

func (r *WorldReadableFilesRule) Confidence() float64

Confidence bumps this rule to tier-1 (high). AST dispatch on simple_identifier nodes means matches inside comments or string literals can no longer occur — those live under line_comment / string_content, which tree-sitter does not treat as identifiers.

func (*WorldReadableFilesRule) Meta

type WorldWriteableFilesRule

type WorldWriteableFilesRule struct{ AndroidRule }

WorldWriteableFilesRule detects MODE_WORLD_WRITEABLE usage.

func (*WorldWriteableFilesRule) Confidence

func (r *WorldWriteableFilesRule) Confidence() float64

Confidence bumps this rule to tier-1 (high). AST dispatch on simple_identifier nodes means matches inside comments or string literals can no longer occur — those live under line_comment / string_content, which tree-sitter does not treat as identifiers.

func (*WorldWriteableFilesRule) Meta

type WrongCallRule

type WrongCallRule struct {
	FlatDispatchBase
	AndroidRule
}

WrongCallRule detects calling the wrong View draw/layout methods.

func (*WrongCallRule) Confidence

func (r *WrongCallRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*WrongCallRule) Meta

func (r *WrongCallRule) Meta() api.RuleDescriptor

type WrongCaseResourceRule

type WrongCaseResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

WrongCaseResourceRule detects view tags with incorrect capitalization. Common mistakes include "Textview" instead of "TextView", "linearlayout" instead of "LinearLayout", etc.

func (*WrongCaseResourceRule) Confidence

func (r *WrongCaseResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*WrongCaseResourceRule) Meta

type WrongConstantRule

type WrongConstantRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*WrongConstantRule) Confidence

func (r *WrongConstantRule) Confidence() float64

Confidence is medium-high: findings require a structural call plus either a resolved Android framework target or same-file constant-set annotation.

func (*WrongConstantRule) Meta

func (*WrongConstantRule) NodeTypes

func (r *WrongConstantRule) NodeTypes() []string

type WrongEqualsTypeParameterRule

type WrongEqualsTypeParameterRule struct {
	FlatDispatchBase
	BaseRule
}

--------------------------------------------------------------------------- WrongEqualsTypeParameterRule detects equals(other: String) instead of Any?. ---------------------------------------------------------------------------

func (*WrongEqualsTypeParameterRule) IsFixable

func (r *WrongEqualsTypeParameterRule) IsFixable() bool

func (*WrongEqualsTypeParameterRule) Meta

type WrongFolderResourceRule

type WrongFolderResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

WrongFolderResourceRule detects resources that reference drawables not found in any drawable or mipmap directory.

func (*WrongFolderResourceRule) Confidence

func (r *WrongFolderResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Android resource-id rule. Detection flags R.id/R.layout usage patterns and naming conventions via structural checks on resources. Classified per roadmap/17.

func (*WrongFolderResourceRule) Meta

type WrongImportRule

type WrongImportRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*WrongImportRule) Confidence

func (r *WrongImportRule) Confidence() float64

Confidence: tier-1 for this rule because the detection is purely syntactic — an import_header's `identifier` child carries the exact dotted FQN. No symbol resolution is needed and no source-text heuristics are involved.

func (*WrongImportRule) Meta

type WrongManifestParentManifestRule

type WrongManifestParentManifestRule struct {
	ManifestBase
	AndroidRule
}

WrongManifestParentManifestRule checks for elements declared under the wrong parent. For example, <activity> must be under <application>, <uses-sdk> must be under <manifest>, <uses-library> must be under <application>.

func (*WrongManifestParentManifestRule) Meta

type WrongRegionResourceRule

type WrongRegionResourceRule struct {
	LayoutResourceBase
	AndroidRule
}

WrongRegionResourceRule detects suspicious language/region combinations in resource folder names, such as values-en-rBR (English + Brazil).

func (*WrongRegionResourceRule) Confidence

func (r *WrongRegionResourceRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence.

func (*WrongRegionResourceRule) Meta

type WrongThreadRule

type WrongThreadRule struct {
	FlatDispatchBase
	AndroidRule
}

WrongThreadRule detects UI operations on wrong thread.

func (*WrongThreadRule) Confidence

func (r *WrongThreadRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*WrongThreadRule) Meta

type WrongViewCastRule

type WrongViewCastRule struct {
	FlatDispatchBase
	AndroidRule
}

func (*WrongViewCastRule) Confidence

func (r *WrongViewCastRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. This is an Android-lint port from AOSP; the detection relies on source-text patterns (call names, string literal contents, hardcoded allow- lists of API names) rather than type resolution, so project- specific wrapper APIs can cause false positives or negatives. Classified per roadmap/17.

func (*WrongViewCastRule) Meta

func (*WrongViewCastRule) NodeTypes

func (r *WrongViewCastRule) NodeTypes() []string

type XMLExternalEntityRule

type XMLExternalEntityRule struct {
	FlatDispatchBase
	BaseRule
}

XMLExternalEntityRule detects XML parser factories created without obvious XXE-disabling hardening in the same callable scope.

func (*XMLExternalEntityRule) Confidence

func (r *XMLExternalEntityRule) Confidence() float64

func (*XMLExternalEntityRule) Meta

type ZipSlipUncheckedRule

type ZipSlipUncheckedRule struct {
	FlatDispatchBase
	BaseRule
}

ZipSlipUncheckedRule detects classic Zip-slip vulnerabilities where a zip extraction loop builds a destination File from a zip entry name without a subsequent canonical-path containment check.

func (*ZipSlipUncheckedRule) Confidence

func (r *ZipSlipUncheckedRule) Confidence() float64

Confidence reports a tier-2 (medium) base confidence. Security rule. Detection pattern-matches known-insecure API shapes and argument literals without confirming the receiver type. Classified per roadmap/17.

func (*ZipSlipUncheckedRule) Meta

Source Files

Directories

Path Synopsis
api
Package api defines the krit rule contract: a single Rule struct that declares its dependencies via a Capabilities bitfield and provides a single Check function which receives a Context carrying everything the rule needs.
Package api defines the krit rule contract: a single Rule struct that declares its dependencies via a Capabilities bitfield and provides a single Check function which receives a Context carrying everything the rule needs.
evidence
Package evidence is a thin facade over scanner.File + the wired type resolvers, exposing only the structured questions a rule should ask.
Package evidence is a thin facade over scanner.File + the wired type resolvers, exposing only the structured questions a rule should ask.
Package base holds the rule scaffolding types embedded by every rule implementation: BaseRule (name/ruleset/severity/description metadata and the Finding emit-helper), FlatDispatchBase (marker for flat-dispatch rules), and LineBase (marker for line-pass rules).
Package base holds the rule scaffolding types embedded by every rule implementation: BaseRule (name/ruleset/severity/description metadata and the Finding emit-helper), FlatDispatchBase (marker for flat-dispatch rules), and LineBase (marker for line-pass rules).
Package coroutines is a rules subpackage demonstrating the per-domain topology described in the architecture diagnosis.
Package coroutines is a rules subpackage demonstrating the per-domain topology described in the architecture diagnosis.
Package ruletest is the canonical entry point for unit-testing rules.
Package ruletest is the canonical entry point for unit-testing rules.

Jump to

Keyboard shortcuts

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