Documentation
¶
Index ¶
- Constants
- Variables
- func ActiveRulesV2(disabledSet, enabledSet map[string]bool, allRules, experimental bool) []*api.Rule
- func AllDeprecations() map[string]api.Deprecation
- func AllMetaProviders() []api.MetaProvider
- func AllSuppressionAliases() map[string][]string
- func ApplyConfig(cfg *config.Config)
- func BuildOracleCallTargetFilterV2(enabled []*api.Rule) oracle.CallTargetFilterSummary
- func BuildOracleCallTargetFilterV2ForFiles(enabled []*api.Rule, files []*scanner.File) oracle.CallTargetFilterSummary
- func BuildOracleDeclarationProfileV2(enabled []*api.Rule) oracle.DeclarationProfileSummary
- func BuildOracleFilterRulesV2(enabled []*api.Rule) []oracle.FilterRule
- func CheckConvertToWebp(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckGifUsage(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconColors(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconColorsWithFacts(idx *android.IconIndex, c *scanner.FindingCollector, facts *librarymodel.Facts)
- func CheckIconDensities(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconDipSize(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconDuplicates(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconDuplicatesConfig(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconExpectedSize(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconExtension(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconLauncherShape(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconLocation(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconMissingDensityFolder(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconMixedNinePatch(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconNoDpi(idx *android.IconIndex, c *scanner.FindingCollector)
- func CheckIconXMLAndPng(idx *android.IconIndex, c *scanner.FindingCollector)
- func DeprecationFor(ruleID string) (*api.Deprecation, bool)
- func GetAllRuleExcludes() map[string][]string
- func GetRuleExcludes(ruleName string) []string
- func HasIgnoredAnnotation(text string, ignoredAnnotations []string) bool
- func HasV2Implementation(r *api.Rule) bool
- func IsDefaultActive(name string) bool
- func IsDeprecated(name string) bool
- func IsExperimental(name string) bool
- func IsFileExcluded(filePath string, excludes []string) bool
- func JavaSupportForRule(r *api.Rule) (api.LanguageSupport, bool)
- func KotlinOracleRulesV2(enabled []*api.Rule) []*api.Rule
- func MetaForRule(r *api.Rule) (api.RuleDescriptor, bool)
- func NeedsOracleDeclarationWalk(enabled []*api.Rule) bool
- func NeedsOracleDiagnostics(enabled []*api.Rule) bool
- func NeedsOracleLibraryClasses(enabled []*api.Rule) bool
- func OracleCallTargetFilterNeedsFiles(enabled []*api.Rule) bool
- func OracleFactUnion(enabled []*api.Rule) api.Capabilities
- func RuleNeedsKotlinOracle(r *api.Rule) bool
- func RuleScope(r *api.Rule) api.Scope
- func SetReporter(r *diag.Reporter)
- func SetRuleExcludes(ruleName string, patterns []string)
- func SetRuleProfileLabels(enabled bool) func()
- func SortByRunAfter(rules []*api.Rule) []*api.Rule
- func SortDispatchErrors(errs []DispatchError)
- type AbsentOrWrongFileLicenseRule
- type AbstractClassCanBeConcreteClassRule
- type AbstractClassCanBeInterfaceRule
- type AbstractMemberNotImplementedRule
- type AccidentalOctalRule
- type AdMobInitializedBeforeConsentRule
- type AdapterViewChildrenResourceRule
- type AddJavascriptInterfaceRule
- type AllProjectsBlockRule
- type AllowAllHostnameVerifierRule
- type AllowBackupManifestRule
- type AlsoCouldBeApplyRule
- type AlwaysShowActionResourceRule
- type AnalyticsCallWithoutConsentGateRule
- type AnalyticsEventWithPiiParamNameRule
- type AnalyticsUserIDFromPiiRule
- type AndroidDataDependency
- type AndroidGradlePluginVersionRule
- type AndroidLintCategory
- type AndroidLintSeverity
- type AndroidRule
- type AnimatorDurationIgnoresScaleRule
- type AnvilContributesBindingWithoutScopeRule
- type AnvilMergeComponentEmptyScopeRule
- type AppCompatMethodRule
- type AppCompatResourceRule
- type AppIndexingErrorManifestRule
- type AppIndexingWarningManifestRule
- type ApplyPluginTwiceRule
- type ArrayPrimitiveRule
- type AssertEqualsArgumentOrderRule
- type AssertNullableWithNotNullAssertionRule
- type AssertRule
- type AssertTrueOnComparisonRule
- type AvoidReferentialEqualityRule
- type BackButtonResourceRule
- type BackupRulesRule
- type BaseRule
- type BindsInsteadOfProvidesRule
- type BindsMismatchedArityRule
- type BindsReturnTypeMatchesParamRule
- type BiometricAuthNotFallingBackToDeviceCredentialRule
- type BitmapDecodeWithoutOptionsRule
- type BooleanPropertyNamingRule
- type BracesOnIfStatementsRule
- type BracesOnWhenStatementsRule
- type BroadcastReceiverExportedFlagMissingRule
- type BufferedReadWithoutBufferRule
- type BuildConfigDebugInLibraryRule
- type BuildConfigDebugInvertedRule
- type ButtonCaseResourceRule
- type ButtonOrderResourceRule
- type ButtonStyleResourceRule
- type ByteOrderMarkRule
- type CanBeNonNullableRule
- type CascadingCallWrappingRule
- type CastNullableToNonNullableTypeRule
- type CastToNullableTypeRule
- type ChannelReceiveWithoutCloseRule
- type CharArrayToStringCallRule
- type CheckResultRule
- type ClassNamingRule
- type ClassOrderingRule
- type CleartextTrafficRule
- type ClickableViewAccessibilityResourceRule
- type ClipboardOnSensitiveInputTypeRule
- type CognitiveComplexMethodRule
- type CollapsibleIfStatementsRule
- type CollectInOnCreateWithoutLifecycleRule
- type CollectionsSynchronizedListIterationRule
- type CommentedOutCodeBlockRule
- type CommentedOutImportRule
- type CommitPrefEditsRule
- type CommitTransactionRule
- type CompileSdkMismatchAcrossModulesRule
- type ComplexConditionRule
- type ComplexInterfaceRule
- type ComponentMissingModuleRule
- type ComposeClickableWithoutMinTouchTargetRule
- type ComposeColumnRowInScrollableRule
- type ComposeDecorativeImageContentDescriptionRule
- type ComposeDerivedStateMisuseRule
- type ComposeDisposableEffectMissingDisposeRule
- type ComposeIconButtonMissingContentDescriptionRule
- type ComposeLambdaCapturesUnstableStateRule
- type ComposeLaunchedEffectWithoutKeysRule
- type ComposeModifierBackgroundAfterClipRule
- type ComposeModifierClickableBeforePaddingRule
- type ComposeModifierFillAfterSizeRule
- type ComposeModifierPassedThenChainedRule
- type ComposeMutableDefaultArgumentRule
- type ComposeMutableStateInCompositionRule
- type ComposePainterResourceInLoopRule
- type ComposePreviewAnnotationMissingRule
- type ComposePreviewWithBackingStateRule
- type ComposeRawTextLiteralRule
- type ComposeRememberInListRule
- type ComposeRememberSaveableNonParcelableRule
- type ComposeRememberWithoutKeyRule
- type ComposeSemanticsMissingRoleRule
- type ComposeSideEffectInCompositionRule
- type ComposeStatefulDefaultParameterRule
- type ComposeStringResourceInsideLambdaRule
- type ComposeTextFieldMissingLabelRule
- type ComposeUnstableParameterRule
- type ConcurrentModificationIterationRule
- type ConfigAdapter
- func (a *ConfigAdapter) GetBool(ruleSet, rule, key string, def bool) bool
- func (a *ConfigAdapter) GetInt(ruleSet, rule, key string, def int) int
- func (a *ConfigAdapter) GetString(ruleSet, rule, key, def string) string
- func (a *ConfigAdapter) GetStringList(ruleSet, rule, key string) []string
- func (a *ConfigAdapter) HasKey(ruleSet, rule, key string) bool
- func (a *ConfigAdapter) IsRuleActive(ruleSet, rule string) *bool
- func (a *ConfigAdapter) IsRuleSetActive(ruleSet string) *bool
- func (a *ConfigAdapter) Unwrap() *config.Config
- type ConfigurationsAllSideEffectRule
- type ConstructorParameterNamingRule
- type ContactsAccessWithoutPermissionUIRule
- type ContentDescriptionRule
- type ContentProviderQueryWithSelectionInterpolationRule
- type ConventionPluginAppliedToWrongTargetRule
- type ConventionPluginDeadCodeRule
- type ConvertToWebpRule
- type CopyrightYearOutdatedRule
- type CoroutineLaunchedInTestWithoutRunTestRule
- type CoroutineScopeCreatedButNeverCancelledRule
- type CouldBeSequenceRule
- type CrashlyticsCustomKeyWithPiiRule
- type CursorLoopWithColumnIndexInLoopRule
- type CustomViewStyleableRule
- type CutPasteIDResourceRule
- type CyclomaticComplexMethodRule
- type DaoNotInterfaceRule
- type DaoWithoutAnnotationsRule
- type DataClassContainsFunctionsRule
- type DataClassShouldBeImmutableRule
- type DatabaseInstanceRecreatedRule
- type DatabaseQueryOnMainThreadRule
- type DeadBindingsRule
- type DeadCodeRule
- type DebugToastInProductionRule
- type DebuggableManifestRule
- type DeepLinkMissingAutoVerifyRule
- type DefaultLocaleRule
- type DeferredAwaitInFinallyRule
- type DependenciesInRootProjectRule
- type DependencyFromBintrayRule
- type DependencyFromHTTPRule
- type DependencyFromJcenterRule
- type DependencyLicenseIncompatibleRule
- type DependencyLicenseUnknownRule
- type DependencySnapshotInReleaseRule
- type DependencyVerificationDisabledRule
- type DependencyWithoutGroupRule
- type DeprecatedBlockTagRule
- type DeprecatedDependencyRule
- type DeprecatedRule
- type DeprecationRule
- type DestructuringDeclarationWithTooManyEntriesRule
- type DeviceAdminManifestRule
- type DiCycleDetectionRule
- type DisableBaselineAlignmentResourceRule
- type DisableCertificatePinningRule
- type DispatchError
- type Dispatcher
- func (d *Dispatcher) CrossFileRules() []*api.Rule
- func (d *Dispatcher) GradleRules() []*api.Rule
- func (d *Dispatcher) IconRules() []*api.Rule
- func (d *Dispatcher) ManifestRules() []*api.Rule
- func (d *Dispatcher) ModuleAwareRules() []*api.Rule
- func (d *Dispatcher) ReportMissingCapabilities(oracleAvailable bool, logger func(format string, args ...any))
- func (d *Dispatcher) ResourceRules() []*api.Rule
- func (d *Dispatcher) ResourceSourceRules() []*api.Rule
- func (d *Dispatcher) Run(file *scanner.File) scanner.FindingColumns
- func (d *Dispatcher) RunColumnsWithStats(file *scanner.File) (scanner.FindingColumns, RunStats)
- func (d *Dispatcher) RunGradle(file *scanner.File, cfg *android.BuildConfig) scanner.FindingColumns
- func (d *Dispatcher) RunIcons(file *scanner.File, idx *android.IconIndex) scanner.FindingColumns
- func (d *Dispatcher) RunManifest(file *scanner.File, m *manifest.Manifest) scanner.FindingColumns
- func (d *Dispatcher) RunResource(file *scanner.File, idx *android.ResourceIndex) scanner.FindingColumns
- func (d *Dispatcher) RunResourceSource(file *scanner.File, idx *android.ResourceIndex) scanner.FindingColumns
- func (d *Dispatcher) RunWithStats(file *scanner.File) (scanner.FindingColumns, RunStats)
- func (d *Dispatcher) SetJavaSemanticFacts(facts *javafacts.Facts)
- func (d *Dispatcher) SetLibraryFacts(facts *librarymodel.Facts)
- func (d *Dispatcher) Stats() (dispatched, lineRules, crossFile, moduleAware int)
- type DocumentationOverPrivateFunctionRule
- type DocumentationOverPrivatePropertyRule
- type DontDowncastCollectionTypesRule
- type DoubleMutabilityForCollectionRule
- type DoubleNegativeExpressionRule
- type DoubleNegativeLambdaRule
- type DrawAllocationRule
- type DuplicateActivityManifestRule
- type DuplicateIDsResourceRule
- type DuplicateIncludedIDsResourceRule
- type DuplicateUsesFeatureManifestRule
- type DynamicVersionRule
- type EasterEggRule
- type ElseCaseInsteadOfExhaustiveWhenRule
- type EmptyCatchBlockRule
- type EmptyClassBlockRule
- type EmptyDefaultConstructorRule
- type EmptyDoWhileBlockRule
- type EmptyElseBlockRule
- type EmptyFinallyBlockRule
- type EmptyForBlockRule
- type EmptyFunctionBlockRule
- type EmptyIfBlockRule
- type EmptyInitBlockRule
- type EmptyKotlinFileRule
- type EmptySecondaryConstructorRule
- type EmptyTryBlockRule
- type EmptyWhenBlockRule
- type EmptyWhileBlockRule
- type EndOfSentenceFormatRule
- type EntityMutableColumnRule
- type EntityPrimaryKeyNotStableRule
- type EnumNamingRule
- type EqualsAlwaysReturnsTrueOrFalseRule
- type EqualsNullCallRule
- type EqualsOnSignatureLineRule
- type EqualsWithHashCodeExistRule
- type ErrorUsageWithThrowableRule
- type ExceptionRaisedInUnexpectedLocationRule
- type ExitOutsideMainRule
- type ExplicitCollectionElementAccessMethodRule
- type ExplicitGarbageCollectionCallRule
- type ExplicitItLambdaMultipleParametersRule
- type ExplicitItLambdaParameterRule
- type ExportedContentProviderRule
- type ExportedPreferenceActivityManifestRule
- type ExportedReceiverRule
- type ExportedServiceManifestRule
- type ExportedServiceRule
- type ExportedWithoutPermissionRule
- type ExpressionBodySyntaxRule
- type ExtraTextResourceRule
- type FanInFanOutHotspotRule
- type FieldGetterRule
- type FileFromUntrustedPathRule
- type FirebaseRemoteConfigDefaultsWithPiiRule
- type FixLevel
- type FlatDispatchBase
- type FloatMathRule
- type FlowWithoutFlowOnRule
- type ForEachOnRangeRule
- type ForbiddenAnnotationRule
- type ForbiddenClassNameRule
- type ForbiddenCommentRule
- type ForbiddenEntry
- type ForbiddenImportRule
- type ForbiddenMethodCallRule
- type ForbiddenNamedParamRule
- type ForbiddenOptInRule
- type ForbiddenPublicDataClassRule
- type ForbiddenSuppressRule
- type ForbiddenVoidRule
- type ForeignKeyWithoutOnDeleteRule
- type FragmentConstructorRule
- type FullBackupContentManifestRule
- type FunctionComplexity
- type FunctionNameMaxLengthRule
- type FunctionNameMinLengthRule
- type FunctionNamingRule
- type FunctionOnlyReturningConstantRule
- type FunctionParameterNamingRule
- type GetInstanceRule
- type GetSignaturesRule
- type GifUsageRule
- type GlobalCoroutineUsageRule
- type GlobalScopeLaunchInViewModelRule
- type GodClassOrModuleRule
- type GoogleAPIKeyInResourcesRule
- type GoogleAppIndexingDeepLinkErrorManifestRule
- type GoogleAppIndexingWarningManifestRule
- type GradleBase
- type GradleBuildContainsTodoRule
- type GradleDeprecatedRule
- type GradleGetterRule
- type GradleIdeErrorRule
- type GradleOldTargetAPIRule
- type GradleOverridesManifestRule
- type GradleOverridesRule
- type GradlePathRule
- type GradlePluginCompatibilityRule
- type GradleWrapperValidationActionRule
- type GrantAllUrisRule
- type GridLayoutRule
- type GsonPolymorphicFromJSONRule
- type HTTPClientNotReusedRule
- type HandlerLeakRule
- type HardcodedAwsAccessKeyRule
- type HardcodedBearerTokenRule
- type HardcodedDateFormatRule
- type HardcodedEnvironmentNameRule
- type HardcodedGcpServiceAccountRule
- type HardcodedHTTPURLRule
- type HardcodedJwtRule
- type HardcodedLocalhostURLRule
- type HardcodedLogTagRule
- type HardcodedNumberFormatRule
- type HardcodedSecretKeyRule
- type HardcodedTextRule
- type HardcodedValuesResourceRule
- type HasPlatformTypeRule
- type HiltEntryPointOnNonInterfaceRule
- type HiltInstallInMismatchRule
- type HiltSingletonWithActivityDepRule
- type IconColorsRule
- type IconDensitiesRule
- type IconDipSizeRule
- type IconDuplicatesConfigRule
- type IconDuplicatesRule
- type IconExpectedSizeRule
- type IconExtensionRule
- type IconLauncherShapeRule
- type IconLocationRule
- type IconMissingDensityFolderRule
- type IconMixedNinePatchRule
- type IconNoDpiRule
- type IconResourceBase
- type IconXMLAndPngRule
- type IgnoredReturnValueRule
- type IllegalResourceRefResourceRule
- type ImageLoadedAtFullSizeInListRule
- type ImageLoaderNoMemoryCacheRule
- type ImplicitDefaultLocaleRule
- type ImplicitPendingIntentRule
- type ImplicitUnitReturnTypeRule
- type ImpliedQuantityResourceRule
- type InOrMmUsageResourceRule
- type IncludeLayoutParamResourceRule
- type InconsistentArraysResourceRule
- type InconsistentLayoutResourceRule
- type InefficientWeightResourceRule
- type InjectDispatcherRule
- type InjectOnAbstractClassRule
- type InlinedAPIRule
- type InnerclassSeparatorRule
- type InsecureBaseConfigurationManifestRule
- type InsecureTrustManagerRule
- type InstanceOfCheckForExceptionRule
- type InstantiatableRule
- type IntentFilterExportRequiredRule
- type IntoMapDuplicateKeyRule
- type IntoMapMissingKeyRule
- type IntoSetDuplicateTypeRule
- type IntoSetOnNonSetReturnRule
- type InvalidIDResourceRule
- type InvalidPackageDeclarationRule
- type InvalidRangeRule
- type InvalidResourceFolderResourceRule
- type InvalidUsesTagAttributeManifestRule
- type IteratorHasNextCallsNextMethodRule
- type IteratorNotThrowingNoSuchElementExceptionRule
- type JacksonDefaultTypingRule
- type JavaObjectInputStreamRule
- type JavaSupportMatrix
- type JdbcPreparedStatementNotClosedRule
- type JdbcResultSetLeakedFromFunctionRule
- type JdbcStatementExecuteRule
- type JvmTargetMismatchRule
- type KDocReferencesNonPublicPropertyRule
- type KdocLinkValidationRule
- type KotlinVersionMismatchAcrossModulesRule
- type LabelForResourceRule
- type LabeledExpressionRule
- type LambdaParameterNamingRule
- type LargeClassRule
- type LateinitUsageRule
- type LaunchWithoutCoroutineExceptionHandlerRule
- type LayerDependencyViolationRule
- type LayoutAutofillHintMismatchRule
- type LayoutClickableWithoutMinSizeRule
- type LayoutEditTextMissingImportanceRule
- type LayoutImportantForAccessibilityNoRule
- type LayoutInflationRule
- type LayoutMinTouchTargetInButtonRowRule
- type LayoutResourceBase
- type LazyColumnInsideColumnRule
- type LazyInsteadOfDirectRule
- type LgplStaticLinkingInApkRule
- type LibraryCodeMustSpecifyReturnTypeRule
- type LibraryCustomViewRule
- type LibraryEntitiesShouldNotBePublicRule
- type LineBase
- type LocalSuppressRule
- type LocaleConfigMissingRule
- type LocaleConfigStaleResourceRule
- type LocaleDefaultForCurrencyRule
- type LocaleFolderRule
- type LocaleGetDefaultForFormattingRule
- type LocationBackgroundWithoutRationaleRule
- type LogDetectorRule
- type LogLevelGuardMissingRule
- type LogOfSharedPreferenceReadRule
- type LogPiiRule
- type LogTagLengthRule
- type LogTagMismatchRule
- type LogWithoutCorrelationIDRule
- type LoggerInterpolatedMessageRule
- type LoggerStringConcatRule
- type LoggerWithoutLoggerFieldRule
- type LongMethodRule
- type LongParameterListRule
- type LoopWithTooManyJumpStatementsRule
- type MagicNumberRule
- type MainDispatcherInLibraryCodeRule
- type MandatoryBracesLoopsRule
- type MangledCRLFRule
- type Manifest
- type ManifestApplication
- type ManifestBase
- type ManifestComponent
- type ManifestElement
- type ManifestMetaData
- type ManifestOrderManifestRule
- type ManifestTypoRule
- type ManifestUsesFeature
- type MapGetWithNotNullAssertionRule
- type MatchingDeclarationNameRule
- type MavenLocalRule
- type MaxChainedCallsOnSameLineRule
- type MaxLineLengthRule
- type MayBeConstantRule
- type MdcAcrossCoroutineBoundaryRule
- type MdcPutNoRemoveRule
- type MemberNameEqualsClassNameRule
- type MergeConflictMarkerLeftoverRule
- type MergeRootFrameResourceRule
- type MethodOverloadingRule
- type MetricCounterNotMonotonicRule
- type MetricNameMissingUnitRule
- type MetricTagHighCardinalityRule
- type MetricTimerOutsideBlockRule
- type MetroFactoryDeclarationShapeRule
- type MinSdkTooLowRule
- type MipmapLauncherRule
- type MissingApplicationIconRule
- type MissingContentDescriptionResourceRule
- type MissingExportedFlagRule
- type MissingGradleChecksumsRule
- type MissingIDResourceRule
- type MissingJvmSuppressWildcardsRule
- type MissingLeanbackLauncherManifestRule
- type MissingLeanbackSupportManifestRule
- type MissingPackageDeclarationRule
- type MissingPermissionRule
- type MissingPrefixResourceRule
- type MissingQuantityResourceRule
- type MissingRegisteredManifestRule
- type MissingReturnRule
- type MissingSpdxIdentifierRule
- type MissingSuperCallRule
- type MissingUseCallRule
- type MissingVersionManifestRule
- type MixedAssertionLibrariesRule
- type MockLocationManifestRule
- type MockWithoutVerifyRule
- type ModifierOrderRule
- type ModuleAwareNeeds
- type ModuleAwareRuleTuning
- type ModuleDeadCodeRule
- type ModuleDependencyCycleRule
- type ModuleTemplateConformanceRule
- type ModuleWithNonStaticProvidesRule
- type MultilineLambdaItParameterRule
- type MultilineRawStringIndentationRule
- type MultipleUsesSdkManifestRule
- type MutableStateInObjectRule
- type NamedArgumentsRule
- type NamespaceTypoResourceRule
- type NegativeMarginResourceRule
- type NestedBlockDepthRule
- type NestedClassesVisibilityRule
- type NestedScopeFunctionsRule
- type NestedScrollingResourceRule
- type NestedScrollingRule
- type NestedWeightsResourceRule
- type NetworkSecurityConfigDebugOverridesRule
- type NewAPIRule
- type NewLineAtEndOfFileRule
- type NewerVersionAvailableRule
- type NfcTechWhitespaceRule
- type NoElseInWhenSealedRule
- type NoNameShadowingRule
- type NoTabsRule
- type NonASCIIIdentifierRule
- type NonBooleanPropertyPrefixedWithIsRule
- type NonInternationalizedSmsRule
- type NotImplementedDeclarationRule
- type NotSiblingResourceRule
- type NoticeFileOutOfDateRule
- type NullCheckOnMutablePropertyRule
- type NullableBooleanCheckRule
- type NullableStructuredFieldRule
- type NullableToStringCallRule
- type ObjectAnimatorBindingRule
- type ObjectExtendsThrowableRule
- type ObjectLiteralToLambdaRule
- type ObjectPropertyNamingRule
- type ObsoleteLayoutParamsResourceRule
- type ObsoleteLayoutParamsRule
- type OkHTTPCallExecuteSyncRule
- type OkHTTPClientCreatedPerCallRule
- type OkHTTPDisableSslValidationRule
- type OnClickResourceRule
- type OnClickRule
- type OpenForTestingCallerInNonTestRule
- type OptInMarkerExposedPubliclyRule
- type OptInMarkerNotRecognisedRule
- type OptInWithoutJustificationRule
- type OptionalAbstractKeywordRule
- type OptionalUnitRule
- type OrientationResourceRule
- type OssLicensesNotIncludedInAndroidRule
- type OutdatedDocumentationRule
- type OverdrawResourceRule
- type OverrideAbstractRule
- type OverrideRule
- type OverrideSignatureMismatchRule
- type PackageDependencyCycleRule
- type PackageDependencyEdge
- type PackageDependencyGraphData
- type PackageNamingConventionDriftRule
- type PackageNamingRule
- type ParcelCreatorRule
- type PeriodicWorkRequestLessThan15MinRule
- type PermissionImpliesUnsupportedHardwareManifestRule
- type PlainFileWriteOfSensitiveRule
- type PluralsBuiltWithIfElseRule
- type PluralsCandidateRule
- type PluralsMissingZeroRule
- type Precision
- type PrintStackTraceInProductionRule
- type PrintStackTraceRule
- type PrintlnInProductionRule
- type PrivateKeyRule
- type PrngFromSystemTimeRule
- type ProcessBuilderShellArgRule
- type ProguardRule
- type ProguardSplitRule
- type PropertyEscapeRule
- type PropertyUsedBeforeDeclarationRule
- type ProtectedMemberInFinalClassRule
- type ProtectedPermissionsManifestRule
- type ProviderInsteadOfLazyRule
- type PublicToInternalLeakyAbstractionRule
- type PxUsageResourceRule
- type RangeRule
- type RangeUntilInsteadOfRangeToRule
- type RecycleRule
- type RecyclerAdapterStableIDsDefaultRule
- type RecyclerAdapterWithoutDiffUtilRule
- type RecyclerViewInLazyColumnRule
- type RedundantConstructorKeywordRule
- type RedundantExplicitTypeRule
- type RedundantHigherOrderMapUsageRule
- type RedundantSuspendModifierRule
- type RedundantVisibilityModifierRule
- type RegisteredRule
- type RelativeOverlapResourceRule
- type RelaxedMockUsedForValueClassRule
- type RemoteVersionRule
- type ReplaceSafeCallChainWithRunRule
- type RequiredSizeResourceRule
- type RequiresOptInWithoutLevelRule
- type RequiresOptInWithoutMessageRule
- type ResAutoResourceRule
- type ResourceAsColorRule
- type ResourceBase
- type ResourceNameRule
- type ResourceTypeRule
- type RethrowCaughtExceptionRule
- type RetrofitCreateInHotPathRule
- type ReturnCountRule
- type ReturnFromFinallyRule
- type RoomConflictStrategyReplaceOnFkRule
- type RoomDatabaseVersionNotBumpedRule
- type RoomEntityChangedMigrationMissingRule
- type RoomExportSchemaDisabledRule
- type RoomFallbackToDestructiveMigrationRule
- type RoomFlowQueryWithoutDistinctRule
- type RoomLoadsAllWhereFirstUsedRule
- type RoomMigrationUsesExecSQLWithInterpolationRule
- type RoomMultipleWritesMissingTransactionRule
- type RoomQueryMissingWhereForUpdateRule
- type RoomQueryWithLikeMissingEscapeRule
- type RoomRawQueryStringConcatRule
- type RoomRelationWithoutIndexRule
- type RoomSelectStarWithoutLimitRule
- type RoomSuspendQueryInTransactionRule
- type RsaNoPaddingRule
- type RtlAwareRule
- type RtlCompatManifestRule
- type RtlEnabledManifestRule
- type RtlFieldAccessRule
- type RtlHardcodedResourceRule
- type RtlSuperscriptResourceRule
- type RtlSymmetryResourceRule
- type RuleExecutionStat
- type RunBlockingInTestRule
- type RunStats
- type RunTestWithDelayRule
- type RunTestWithThreadSleepRule
- type RuntimeExecUnsafeShapeRule
- type SQLInjectionRawQueryRule
- type SQLiteStringRule
- type SafeCastRule
- type SampleAnnotationFreshnessRule
- type ScopeOnParameterizedClassRule
- type ScreenshotNotBlockedOnLoginScreenRule
- type ScrollViewCountResourceRule
- type ScrollViewCountRule
- type ScrollViewSizeResourceRule
- type SdCardPathRule
- type SecureRandomRule
- type SerialVersionUIDInSerializableClassRule
- type ServiceCastRule
- type ServiceExportedManifestRule
- type SetJavaScriptEnabledRule
- type SetTextI18nRule
- type SharedFlowWithoutReplayRule
- type SharedMutableStateInObjectRule
- type SharedPreferencesForSensitiveKeyRule
- type ShiftFlagsRule
- type ShortAlarmRule
- type SimpleDateFormatRule
- type SingletonOnMutableClassRule
- type SleepInsteadOfDelayRule
- type SmallSpResourceRule
- type SmartCastInvalidatedRule
- type SpUsageResourceRule
- type SpacingAfterPackageAndImportsRule
- type SpanAttributeWithHighCardinalityRule
- type SpanStartWithoutFinishRule
- type SparseArrayRule
- type SpdxIdentifierInvalidRule
- type SpdxIdentifierMismatchWithProjectRule
- type SpreadOperatorRule
- type SpyOnDataClassRule
- type SqliteCursorWithoutCloseRule
- type StartActivityWithUntrustedIntentRule
- type StateFlowCompareByReferenceRule
- type StateFlowMutableLeakRule
- type StateListReachableResourceRule
- type StaticIvRule
- type StopShipRule
- type StringConcatForTranslationRule
- type StringContainsHTMLWithoutCDATARule
- type StringFormatCountResourceRule
- type StringFormatInvalidResourceRule
- type StringFormatMatchesResourceRule
- type StringFormatTrivialResourceRule
- type StringIntegerRule
- type StringLiteralDuplicationRule
- type StringNotLocalizableResourceRule
- type StringNotSelectableRule
- type StringRepeatedInContentDescriptionRule
- type StringResourceMissingPositionalRule
- type StringResourcePlaceholderOrderRule
- type StringShouldBeRawStringRule
- type StringSpanInContentDescriptionRule
- type StringTemplateForTranslationRule
- type StringTrailingWhitespaceResourceRule
- type StructuredLogKeyMixedCaseRule
- type SubcomponentNotInstalledRule
- type SupervisorScopeInEventHandlerRule
- type SupportAnnotationUsageRule
- type SuppressedWarningWithoutJustificationRule
- type SuspendFunInFinallySectionRule
- type SuspendFunSwallowedCancellationRule
- type SuspendFunWithCoroutineScopeReceiverRule
- type SuspendFunWithFlowReturnTypeRule
- type Suspicious0dpResourceRule
- type SwallowedExceptionRule
- type SwitchIntDefRule
- type SynchronizedOnBoxedPrimitiveRule
- type SynchronizedOnNonFinalRule
- type SynchronizedOnStringRule
- type SystemPermissionRule
- type TargetNewerRule
- type TempFileWorldReadableRule
- type TestDispatcherNotInjectedRule
- type TestFixtureAccessedFromProductionRule
- type TestFunctionReturnValueRule
- type TestInheritanceDepthRule
- type TestNameContainsUnderscoreRule
- type TestOnlyImportInProductionRule
- type TestWithOnlyTodoRule
- type TestWithoutAssertionRule
- type TextDirectionLiteralInStringRule
- type TextFieldsResourceRule
- type TextViewEditsRule
- type ThrowingExceptionFromFinallyRule
- type ThrowingExceptionInMainRule
- type ThrowingExceptionsWithoutMessageOrCauseRule
- type ThrowingNewInstanceOfSameExceptionRule
- type ThrowsCountRule
- type TimberTreeNotPlantedRule
- type ToastForAccessibilityAnnouncementRule
- type ToastRule
- type TooDeepLayoutResourceRule
- type TooGenericExceptionCaughtRule
- type TooGenericExceptionThrownRule
- type TooManyFunctionsRule
- type TooManyViewsResourceRule
- type TopLevelPropertyNamingRule
- type TraceIDLoggedAsPlainMessageRule
- type TrailingWhitespaceRule
- type TranslatableMarkupMismatchRule
- type TrimMultilineRawStringRule
- type TrulyRandomRule
- type TrustedServerRule
- type UnconditionalJumpStatementInLoopRule
- type UnderscoresInNumericLiteralsRule
- type UndocumentedPublicClassRule
- type UndocumentedPublicFunctionRule
- type UndocumentedPublicPropertyRule
- type UnicodeNormalizationMissingRule
- type UniqueConstantsRule
- type UniquePermissionRule
- type UnknownIDInLayoutRule
- type UnnamedParameterUseRule
- type UnnecessaryAnyRule
- type UnnecessaryApplyRule
- type UnnecessaryBackticksRule
- type UnnecessaryBracesAroundTrailingLambdaRule
- type UnnecessaryFilterRule
- type UnnecessaryFullyQualifiedNameRule
- type UnnecessaryInheritanceRule
- type UnnecessaryInitOnArrayRule
- type UnnecessaryInnerClassRule
- type UnnecessaryLetRule
- type UnnecessaryNotNullCheckRule
- type UnnecessaryNotNullOperatorRule
- type UnnecessaryParenthesesRule
- type UnnecessaryPartOfBinaryExpressionRule
- type UnnecessaryReversedRule
- type UnnecessarySafeCallRule
- type UnnecessaryTemporaryInstantiationRule
- type UnnecessaryTypeCastingRule
- type UnpackedNativeCodeManifestRule
- type UnprotectedDynamicReceiverRule
- type UnprotectedSMSBroadcastReceiverManifestRule
- type UnreachableCatchBlockRule
- type UnreachableCodeRule
- type UnsafeCallOnNullableTypeRule
- type UnsafeCastRule
- type UnsafeProtectedBroadcastReceiverManifestRule
- type UnstructuredErrorLogRule
- type UnsupportedChromeOsHardwareManifestRule
- type UntestedPublicAPIRule
- type UnusedAttributeResourceRule
- type UnusedImportRule
- type UnusedNamespaceResourceRule
- type UnusedParameterRule
- type UnusedPrivateClassRule
- type UnusedPrivateFunctionRule
- type UnusedPrivateMemberRule
- type UnusedPrivatePropertyRule
- type UnusedQuantityResourceRule
- type UnusedResourcesRule
- type UnusedUnaryOperatorRule
- type UnusedVariableRule
- type UpperLowerInvariantMisuseRule
- type UseAlpha2Rule
- type UseAnyOrNoneInsteadOfFindRule
- type UseArrayLiteralsInAnnotationsRule
- type UseCheckNotNullRule
- type UseCheckOrErrorRule
- type UseCheckPermissionManifestRule
- type UseCompoundDrawablesResourceRule
- type UseDataClassRule
- type UseEmptyCounterpartRule
- type UseIfEmptyOrIfBlankRule
- type UseIfInsteadOfWhenRule
- type UseIsNullOrEmptyRule
- type UseLetRule
- type UseOrEmptyRule
- type UseRequireNotNullRule
- type UseRequireRule
- type UseSumOfInsteadOfFlatMapSizeRule
- type UseValueOfRule
- type UselessCallOnNotNullRule
- type UselessLeafResourceRule
- type UselessParentResourceRule
- type UselessPostfixExpressionRule
- type UsesSdkManifestRule
- type UtilityClassWithPublicConstructorRule
- type ValuesArraysResourceBase
- type ValuesExtraTextResourceBase
- type ValuesPluralsResourceBase
- type ValuesResourceBase
- type ValuesStringsResourceBase
- type VarCouldBeValRule
- type VariableMaxLengthRule
- type VariableMinLengthRule
- type VariableNamingRule
- type VerifyWithoutMockRule
- type VersionCatalogBuildSrcMismatchRule
- type VersionCatalogDuplicateVersionRule
- type VersionCatalogRawVersionInBuildRule
- type VersionCatalogUnusedRule
- type ViewConstructorRule
- type ViewHolderRule
- type ViewTagRule
- type VisibleForTestingCallerInNonTestRule
- type VolatileMissingOnDclRule
- type WakelockRule
- type WeakKeySizeRule
- type WeakMacAlgorithmRule
- type WeakMessageDigestRule
- type WebViewAllowContentAccessRule
- type WebViewAllowFileAccessRule
- type WebViewDebuggingEnabledRule
- type WebViewFileAccessFromFileUrlsRule
- type WebViewInScrollViewResourceRule
- type WebViewMixedContentAllowAllRule
- type WebViewUniversalAccessFromFileUrlsRule
- type WildcardImportRule
- type WithContextInSuspendFunctionNoopRule
- type WithContextWithoutTracingContextRule
- type WorkManagerNoBackoffRule
- type WorkManagerUniquePolicyKeepButReplaceIntendedRule
- type WorldReadableFilesRule
- type WorldWriteableFilesRule
- type WrongCallRule
- type WrongCaseResourceRule
- type WrongConstantRule
- type WrongEqualsTypeParameterRule
- type WrongFolderResourceRule
- type WrongImportRule
- type WrongManifestParentManifestRule
- type WrongRegionResourceRule
- type WrongThreadRule
- type WrongViewCastRule
- type XMLExternalEntityRule
- type ZipSlipUncheckedRule
Constants ¶
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.
const AndroidDepResources = AndroidDepValues
const AndroidDepValues = AndroidDepValuesStrings | AndroidDepValuesDimensions | AndroidDepValuesPlurals | AndroidDepValuesArrays | AndroidDepValuesExtraText
const JavaLanguageSupportKey = "java"
Variables ¶
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.
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.
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.)
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 ¶
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 ¶
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 ¶
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 ¶
GetRuleExcludes returns the glob patterns for file exclusion for a rule.
func HasIgnoredAnnotation ¶
HasIgnoredAnnotation checks if a declaration text contains any of the ignored annotations. Matches both simple names and fully-qualified names.
func HasV2Implementation ¶
HasV2Implementation reports whether a rule has both executable analysis logic and a declared dispatcher route.
func IsDefaultActive ¶
IsDefaultActive returns whether a rule is active by default.
func IsDeprecated ¶
IsDeprecated reports whether a rule's Maturity is MaturityDeprecated. Returns false for stable, experimental, or unknown rule IDs.
func IsExperimental ¶
IsExperimental reports whether a rule's Maturity is MaturityExperimental. Returns false for stable, deprecated, or unknown rule IDs.
func IsFileExcluded ¶
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 ¶
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 ¶
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 ¶
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 ¶
NeedsOracleLibraryClasses reports whether any active rule needs the JAR / library closure (Dependencies map). When false, krit-types can skip the library walk.
func OracleCallTargetFilterNeedsFiles ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
func (r *AbsentOrWrongFileLicenseRule) Meta() api.RuleDescriptor
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 ¶
func (r *AbstractClassCanBeConcreteClassRule) Confidence() float64
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 (r *AbstractClassCanBeConcreteClassRule) IsFixable() bool
func (*AbstractClassCanBeConcreteClassRule) Meta ¶
func (r *AbstractClassCanBeConcreteClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *AbstractClassCanBeInterfaceRule) Meta() api.RuleDescriptor
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 ¶
func (r *AccidentalOctalRule) Meta() api.RuleDescriptor
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 ¶
func (r *AdMobInitializedBeforeConsentRule) Confidence() float64
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 ¶
func (r *AdMobInitializedBeforeConsentRule) Meta() api.RuleDescriptor
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 ¶
func (r *AdapterViewChildrenResourceRule) Meta() api.RuleDescriptor
type AddJavascriptInterfaceRule ¶
type AddJavascriptInterfaceRule struct {
FlatDispatchBase
AndroidRule
}
AddJavascriptInterfaceRule detects WebView.addJavascriptInterface() calls.
func (*AddJavascriptInterfaceRule) Meta ¶
func (r *AddJavascriptInterfaceRule) Meta() api.RuleDescriptor
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 ¶
func (r *AllProjectsBlockRule) Meta() api.RuleDescriptor
type AllowAllHostnameVerifierRule ¶
type AllowAllHostnameVerifierRule struct {
FlatDispatchBase
AndroidRule
}
func (*AllowAllHostnameVerifierRule) Confidence ¶
func (r *AllowAllHostnameVerifierRule) Confidence() float64
func (*AllowAllHostnameVerifierRule) Meta ¶
func (r *AllowAllHostnameVerifierRule) Meta() api.RuleDescriptor
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 ¶
func (r *AllowBackupManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *AlsoCouldBeApplyRule) Meta() api.RuleDescriptor
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 ¶
func (r *AlwaysShowActionResourceRule) Meta() api.RuleDescriptor
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 (r *AnalyticsCallWithoutConsentGateRule) Confidence() float64
func (*AnalyticsCallWithoutConsentGateRule) Meta ¶
func (r *AnalyticsCallWithoutConsentGateRule) Meta() api.RuleDescriptor
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 (r *AnalyticsEventWithPiiParamNameRule) Confidence() float64
func (*AnalyticsEventWithPiiParamNameRule) Meta ¶
func (r *AnalyticsEventWithPiiParamNameRule) Meta() api.RuleDescriptor
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 ¶
func (r *AnalyticsUserIDFromPiiRule) Meta() api.RuleDescriptor
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 ¶
func (r *AndroidGradlePluginVersionRule) Meta() api.RuleDescriptor
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 ¶
func (r *AnimatorDurationIgnoresScaleRule) Meta() api.RuleDescriptor
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 ¶
func (r *AnvilContributesBindingWithoutScopeRule) 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 (*AnvilContributesBindingWithoutScopeRule) Meta ¶
func (r *AnvilContributesBindingWithoutScopeRule) Meta() api.RuleDescriptor
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 ¶
func (r *AnvilMergeComponentEmptyScopeRule) 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 (*AnvilMergeComponentEmptyScopeRule) Meta ¶
func (r *AnvilMergeComponentEmptyScopeRule) Meta() api.RuleDescriptor
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 ¶
func (r *AppCompatMethodRule) Meta() api.RuleDescriptor
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 ¶
func (r *AppCompatResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *AppIndexingErrorManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *AppIndexingWarningManifestRule) Meta() api.RuleDescriptor
type ApplyPluginTwiceRule ¶
type ApplyPluginTwiceRule struct {
GradleBase
BaseRule
}
func (*ApplyPluginTwiceRule) Confidence ¶
func (r *ApplyPluginTwiceRule) Confidence() float64
func (*ApplyPluginTwiceRule) Meta ¶
func (r *ApplyPluginTwiceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ArrayPrimitiveRule) Meta() api.RuleDescriptor
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 ¶
func (r *AssertEqualsArgumentOrderRule) Meta() api.RuleDescriptor
type AssertNullableWithNotNullAssertionRule ¶
type AssertNullableWithNotNullAssertionRule struct {
FlatDispatchBase
BaseRule
}
func (*AssertNullableWithNotNullAssertionRule) Confidence ¶
func (r *AssertNullableWithNotNullAssertionRule) Confidence() float64
func (*AssertNullableWithNotNullAssertionRule) Meta ¶
func (r *AssertNullableWithNotNullAssertionRule) Meta() api.RuleDescriptor
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 ¶
func (r *AssertTrueOnComparisonRule) Meta() api.RuleDescriptor
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 ¶
func (r *AvoidReferentialEqualityRule) Meta() api.RuleDescriptor
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 ¶
func (r *BackButtonResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *BackupRulesRule) Meta() api.RuleDescriptor
type 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 ¶
func (r *BindsInsteadOfProvidesRule) Meta() api.RuleDescriptor
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 ¶
func (r *BindsMismatchedArityRule) Meta() api.RuleDescriptor
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 ¶
func (r *BindsReturnTypeMatchesParamRule) Meta() api.RuleDescriptor
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 ¶
func (r *BiometricAuthNotFallingBackToDeviceCredentialRule) Confidence() float64
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 ¶
func (r *BiometricAuthNotFallingBackToDeviceCredentialRule) Meta() api.RuleDescriptor
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 ¶
func (r *BitmapDecodeWithoutOptionsRule) Meta() api.RuleDescriptor
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 ¶
func (r *BooleanPropertyNamingRule) Meta() api.RuleDescriptor
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 ¶
func (r *BracesOnIfStatementsRule) Meta() api.RuleDescriptor
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 ¶
func (r *BracesOnWhenStatementsRule) Meta() api.RuleDescriptor
type BroadcastReceiverExportedFlagMissingRule ¶
type BroadcastReceiverExportedFlagMissingRule struct {
FlatDispatchBase
AndroidRule
}
func (*BroadcastReceiverExportedFlagMissingRule) Confidence ¶
func (r *BroadcastReceiverExportedFlagMissingRule) Confidence() float64
func (*BroadcastReceiverExportedFlagMissingRule) Meta ¶
func (r *BroadcastReceiverExportedFlagMissingRule) Meta() api.RuleDescriptor
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 ¶
func (r *BufferedReadWithoutBufferRule) Meta() api.RuleDescriptor
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 ¶
func (r *BuildConfigDebugInLibraryRule) Meta() api.RuleDescriptor
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 ¶
func (r *BuildConfigDebugInvertedRule) Meta() api.RuleDescriptor
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 ¶
func (r *ButtonCaseResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ButtonOrderResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ButtonStyleResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ByteOrderMarkRule) Meta() api.RuleDescriptor
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 (r *CanBeNonNullableRule) Meta() api.RuleDescriptor
func (*CanBeNonNullableRule) SetResolver ¶
func (r *CanBeNonNullableRule) SetResolver(_ typeinfer.TypeResolver)
type CascadingCallWrappingRule ¶
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 ¶
func (r *CascadingCallWrappingRule) Meta() api.RuleDescriptor
type CastNullableToNonNullableTypeRule ¶
type CastNullableToNonNullableTypeRule struct {
FlatDispatchBase
BaseRule
}
--------------------------------------------------------------------------- CastNullableToNonNullableTypeRule detects `as Type` on nullable expression. ---------------------------------------------------------------------------
func (*CastNullableToNonNullableTypeRule) Confidence ¶
func (r *CastNullableToNonNullableTypeRule) Confidence() float64
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 ¶
func (r *CastNullableToNonNullableTypeRule) Meta() api.RuleDescriptor
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 ¶
func (r *CastToNullableTypeRule) Meta() api.RuleDescriptor
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 ¶
func (r *ChannelReceiveWithoutCloseRule) Meta() api.RuleDescriptor
type CharArrayToStringCallRule ¶
type CharArrayToStringCallRule struct {
FlatDispatchBase
BaseRule
}
--------------------------------------------------------------------------- CharArrayToStringCallRule detects charArray.toString() calls. ---------------------------------------------------------------------------
func (*CharArrayToStringCallRule) IsFixable ¶
func (r *CharArrayToStringCallRule) IsFixable() bool
func (*CharArrayToStringCallRule) Meta ¶
func (r *CharArrayToStringCallRule) Meta() api.RuleDescriptor
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 ¶
func (r *CheckResultRule) Meta() api.RuleDescriptor
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 ¶
func (r *ClassNamingRule) Meta() api.RuleDescriptor
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 ¶
func (r *ClassOrderingRule) Meta() api.RuleDescriptor
type CleartextTrafficRule ¶
type CleartextTrafficRule struct {
ManifestBase
AndroidRule
}
CleartextTrafficRule flags android:usesCleartextTraffic="true" as a security concern.
func (*CleartextTrafficRule) Meta ¶
func (r *CleartextTrafficRule) Meta() api.RuleDescriptor
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 ¶
func (r *ClickableViewAccessibilityResourceRule) 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 (*ClickableViewAccessibilityResourceRule) Meta ¶
func (r *ClickableViewAccessibilityResourceRule) Meta() api.RuleDescriptor
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 (r *ClipboardOnSensitiveInputTypeRule) Confidence() float64
func (*ClipboardOnSensitiveInputTypeRule) Meta ¶
func (r *ClipboardOnSensitiveInputTypeRule) Meta() api.RuleDescriptor
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 ¶
func (r *CognitiveComplexMethodRule) Meta() api.RuleDescriptor
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 ¶
func (r *CollapsibleIfStatementsRule) Meta() api.RuleDescriptor
type CollectInOnCreateWithoutLifecycleRule ¶
type CollectInOnCreateWithoutLifecycleRule struct {
FlatDispatchBase
BaseRule
}
CollectInOnCreateWithoutLifecycleRule detects Flow.collect calls in lifecycle callbacks that are not wrapped by repeatOnLifecycle.
func (*CollectInOnCreateWithoutLifecycleRule) Confidence ¶
func (r *CollectInOnCreateWithoutLifecycleRule) 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 (*CollectInOnCreateWithoutLifecycleRule) Meta ¶
func (r *CollectInOnCreateWithoutLifecycleRule) Meta() api.RuleDescriptor
type CollectionsSynchronizedListIterationRule ¶
type CollectionsSynchronizedListIterationRule struct {
FlatDispatchBase
BaseRule
}
CollectionsSynchronizedListIterationRule detects iteration over synchronized wrappers without external sync.
func (*CollectionsSynchronizedListIterationRule) Confidence ¶
func (r *CollectionsSynchronizedListIterationRule) Confidence() float64
func (*CollectionsSynchronizedListIterationRule) Meta ¶
func (r *CollectionsSynchronizedListIterationRule) Meta() api.RuleDescriptor
type CommentedOutCodeBlockRule ¶
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 ¶
func (r *CommentedOutCodeBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *CommentedOutImportRule) Meta() api.RuleDescriptor
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 ¶
func (r *CommitPrefEditsRule) Meta() api.RuleDescriptor
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 ¶
func (r *CommitTransactionRule) Meta() api.RuleDescriptor
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 ¶
func (r *CompileSdkMismatchAcrossModulesRule) Confidence() float64
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 (r *CompileSdkMismatchAcrossModulesRule) Meta() api.RuleDescriptor
func (*CompileSdkMismatchAcrossModulesRule) ModuleAwareNeeds ¶
func (r *CompileSdkMismatchAcrossModulesRule) ModuleAwareNeeds() 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 ¶
func (r *ComplexConditionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComplexInterfaceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComponentMissingModuleRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeClickableWithoutMinTouchTargetRule) 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 (*ComposeClickableWithoutMinTouchTargetRule) Meta ¶
func (r *ComposeClickableWithoutMinTouchTargetRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeColumnRowInScrollableRule) Meta() api.RuleDescriptor
type ComposeDecorativeImageContentDescriptionRule ¶
type ComposeDecorativeImageContentDescriptionRule struct {
FlatDispatchBase
BaseRule
}
func (*ComposeDecorativeImageContentDescriptionRule) Confidence ¶
func (r *ComposeDecorativeImageContentDescriptionRule) Confidence() float64
func (*ComposeDecorativeImageContentDescriptionRule) Meta ¶
func (r *ComposeDecorativeImageContentDescriptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeDerivedStateMisuseRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeDisposableEffectMissingDisposeRule) 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 (*ComposeDisposableEffectMissingDisposeRule) Meta ¶
func (r *ComposeDisposableEffectMissingDisposeRule) Meta() api.RuleDescriptor
type ComposeIconButtonMissingContentDescriptionRule ¶
type ComposeIconButtonMissingContentDescriptionRule struct {
FlatDispatchBase
BaseRule
}
func (*ComposeIconButtonMissingContentDescriptionRule) Confidence ¶
func (r *ComposeIconButtonMissingContentDescriptionRule) Confidence() float64
func (*ComposeIconButtonMissingContentDescriptionRule) Meta ¶
func (r *ComposeIconButtonMissingContentDescriptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeLambdaCapturesUnstableStateRule) 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 (*ComposeLambdaCapturesUnstableStateRule) Meta ¶
func (r *ComposeLambdaCapturesUnstableStateRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeLaunchedEffectWithoutKeysRule) 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 (*ComposeLaunchedEffectWithoutKeysRule) Meta ¶
func (r *ComposeLaunchedEffectWithoutKeysRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeModifierBackgroundAfterClipRule) 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 (*ComposeModifierBackgroundAfterClipRule) Meta ¶
func (r *ComposeModifierBackgroundAfterClipRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeModifierClickableBeforePaddingRule) 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 (*ComposeModifierClickableBeforePaddingRule) Meta ¶
func (r *ComposeModifierClickableBeforePaddingRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeModifierFillAfterSizeRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeModifierPassedThenChainedRule) 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 (*ComposeModifierPassedThenChainedRule) Meta ¶
func (r *ComposeModifierPassedThenChainedRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeMutableDefaultArgumentRule) 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 (*ComposeMutableDefaultArgumentRule) Meta ¶
func (r *ComposeMutableDefaultArgumentRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeMutableStateInCompositionRule) 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 (*ComposeMutableStateInCompositionRule) Meta ¶
func (r *ComposeMutableStateInCompositionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposePainterResourceInLoopRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposePreviewAnnotationMissingRule) 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 (*ComposePreviewAnnotationMissingRule) Meta ¶
func (r *ComposePreviewAnnotationMissingRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposePreviewWithBackingStateRule) 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 (*ComposePreviewWithBackingStateRule) Meta ¶
func (r *ComposePreviewWithBackingStateRule) Meta() api.RuleDescriptor
type ComposeRawTextLiteralRule ¶
type ComposeRawTextLiteralRule struct {
FlatDispatchBase
BaseRule
CustomPreviewWildcard bool
CustomPreviewPrefixes []string
}
func (*ComposeRawTextLiteralRule) Confidence ¶
func (r *ComposeRawTextLiteralRule) Confidence() float64
func (*ComposeRawTextLiteralRule) Meta ¶
func (r *ComposeRawTextLiteralRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeRememberInListRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeRememberSaveableNonParcelableRule) 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 (*ComposeRememberSaveableNonParcelableRule) Meta ¶
func (r *ComposeRememberSaveableNonParcelableRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeRememberWithoutKeyRule) Meta() api.RuleDescriptor
type ComposeSemanticsMissingRoleRule ¶
type ComposeSemanticsMissingRoleRule struct {
FlatDispatchBase
BaseRule
CustomPreviewWildcard bool
CustomPreviewPrefixes []string
}
func (*ComposeSemanticsMissingRoleRule) Confidence ¶
func (r *ComposeSemanticsMissingRoleRule) Confidence() float64
func (*ComposeSemanticsMissingRoleRule) Meta ¶
func (r *ComposeSemanticsMissingRoleRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeSideEffectInCompositionRule) 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 (*ComposeSideEffectInCompositionRule) Meta ¶
func (r *ComposeSideEffectInCompositionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeStatefulDefaultParameterRule) 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 (*ComposeStatefulDefaultParameterRule) Meta ¶
func (r *ComposeStatefulDefaultParameterRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeStringResourceInsideLambdaRule) 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 (*ComposeStringResourceInsideLambdaRule) Meta ¶
func (r *ComposeStringResourceInsideLambdaRule) Meta() api.RuleDescriptor
type ComposeTextFieldMissingLabelRule ¶
type ComposeTextFieldMissingLabelRule struct {
FlatDispatchBase
BaseRule
}
func (*ComposeTextFieldMissingLabelRule) Confidence ¶
func (r *ComposeTextFieldMissingLabelRule) Confidence() float64
func (*ComposeTextFieldMissingLabelRule) Meta ¶
func (r *ComposeTextFieldMissingLabelRule) Meta() api.RuleDescriptor
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 ¶
func (r *ComposeUnstableParameterRule) Meta() api.RuleDescriptor
type ConcurrentModificationIterationRule ¶
type ConcurrentModificationIterationRule struct {
FlatDispatchBase
BaseRule
}
ConcurrentModificationIterationRule detects collection mutation inside for loops.
func (*ConcurrentModificationIterationRule) Confidence ¶
func (r *ConcurrentModificationIterationRule) Confidence() float64
func (*ConcurrentModificationIterationRule) Meta ¶
func (r *ConcurrentModificationIterationRule) Meta() api.RuleDescriptor
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 ¶
func (r *ConfigurationsAllSideEffectRule) Meta() api.RuleDescriptor
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 ¶
func (r *ConstructorParameterNamingRule) Meta() api.RuleDescriptor
type ContactsAccessWithoutPermissionUIRule ¶
type ContactsAccessWithoutPermissionUIRule struct {
FlatDispatchBase
BaseRule
}
ContactsAccessWithoutPermissionUIRule flags contacts queries that are not gated behind a RequestPermission activity-result callback.
func (*ContactsAccessWithoutPermissionUIRule) Confidence ¶
func (r *ContactsAccessWithoutPermissionUIRule) Confidence() float64
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 ¶
func (r *ContactsAccessWithoutPermissionUIRule) Meta() api.RuleDescriptor
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 ¶
func (r *ContentDescriptionRule) Meta() api.RuleDescriptor
type ContentProviderQueryWithSelectionInterpolationRule ¶
type ContentProviderQueryWithSelectionInterpolationRule struct {
FlatDispatchBase
BaseRule
}
ContentProviderQueryWithSelectionInterpolationRule detects interpolated selection strings passed to ContentResolver.query(...).
func (*ContentProviderQueryWithSelectionInterpolationRule) Confidence ¶
func (r *ContentProviderQueryWithSelectionInterpolationRule) 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 (*ContentProviderQueryWithSelectionInterpolationRule) Meta ¶
func (r *ContentProviderQueryWithSelectionInterpolationRule) Meta() api.RuleDescriptor
type ConventionPluginAppliedToWrongTargetRule ¶
func (*ConventionPluginAppliedToWrongTargetRule) Confidence ¶
func (r *ConventionPluginAppliedToWrongTargetRule) Confidence() float64
func (*ConventionPluginAppliedToWrongTargetRule) Meta ¶
func (r *ConventionPluginAppliedToWrongTargetRule) Meta() api.RuleDescriptor
func (*ConventionPluginAppliedToWrongTargetRule) ModuleAwareNeeds ¶
func (r *ConventionPluginAppliedToWrongTargetRule) ModuleAwareNeeds() 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 (r *ConventionPluginDeadCodeRule) Meta() api.RuleDescriptor
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 ¶
func (r *ConvertToWebpRule) Meta() api.RuleDescriptor
type CopyrightYearOutdatedRule ¶
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 ¶
func (r *CoroutineLaunchedInTestWithoutRunTestRule) 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 (*CoroutineLaunchedInTestWithoutRunTestRule) Meta ¶
func (r *CoroutineLaunchedInTestWithoutRunTestRule) Meta() api.RuleDescriptor
type CoroutineScopeCreatedButNeverCancelledRule ¶
type CoroutineScopeCreatedButNeverCancelledRule struct {
FlatDispatchBase
BaseRule
}
CoroutineScopeCreatedButNeverCancelledRule detects CoroutineScope properties without cancel().
func (*CoroutineScopeCreatedButNeverCancelledRule) Confidence ¶
func (r *CoroutineScopeCreatedButNeverCancelledRule) Confidence() float64
func (*CoroutineScopeCreatedButNeverCancelledRule) Meta ¶
func (r *CoroutineScopeCreatedButNeverCancelledRule) Meta() api.RuleDescriptor
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 ¶
func (r *CouldBeSequenceRule) Meta() api.RuleDescriptor
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 ¶
func (r *CrashlyticsCustomKeyWithPiiRule) Meta() api.RuleDescriptor
type CursorLoopWithColumnIndexInLoopRule ¶
type CursorLoopWithColumnIndexInLoopRule struct {
FlatDispatchBase
BaseRule
}
CursorLoopWithColumnIndexInLoopRule detects getColumnIndex() calls inside cursor.moveToNext() while loops.
func (*CursorLoopWithColumnIndexInLoopRule) Confidence ¶
func (r *CursorLoopWithColumnIndexInLoopRule) Confidence() float64
func (*CursorLoopWithColumnIndexInLoopRule) Meta ¶
func (r *CursorLoopWithColumnIndexInLoopRule) Meta() api.RuleDescriptor
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 ¶
func (r *CustomViewStyleableRule) Meta() api.RuleDescriptor
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 ¶
func (r *CutPasteIDResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *CyclomaticComplexMethodRule) Meta() api.RuleDescriptor
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 ¶
func (r *DaoNotInterfaceRule) Meta() api.RuleDescriptor
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 ¶
func (r *DaoWithoutAnnotationsRule) Meta() api.RuleDescriptor
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 ¶
func (r *DataClassContainsFunctionsRule) Meta() api.RuleDescriptor
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 ¶
func (r *DataClassShouldBeImmutableRule) Meta() api.RuleDescriptor
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 ¶
func (r *DatabaseInstanceRecreatedRule) Meta() api.RuleDescriptor
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 ¶
func (r *DatabaseQueryOnMainThreadRule) Meta() api.RuleDescriptor
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 ¶
func (r *DeadBindingsRule) Meta() api.RuleDescriptor
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 ¶
func (r *DebugToastInProductionRule) Meta() api.RuleDescriptor
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 ¶
func (r *DebuggableManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *DeepLinkMissingAutoVerifyRule) Meta() api.RuleDescriptor
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 ¶
func (r *DefaultLocaleRule) Meta() api.RuleDescriptor
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 ¶
func (r *DeferredAwaitInFinallyRule) Meta() api.RuleDescriptor
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 ¶
func (r *DependenciesInRootProjectRule) Meta() api.RuleDescriptor
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 ¶
func (r *DependencyFromBintrayRule) Meta() api.RuleDescriptor
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 ¶
func (r *DependencyFromHTTPRule) Meta() api.RuleDescriptor
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 ¶
func (r *DependencyFromJcenterRule) Meta() api.RuleDescriptor
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 ¶
func (r *DependencyLicenseIncompatibleRule) Confidence() float64
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 ¶
func (r *DependencySnapshotInReleaseRule) Meta() api.RuleDescriptor
type DependencyVerificationDisabledRule ¶
DependencyVerificationDisabledRule flags Gradle dependency verification set to off or lenient.
func (*DependencyVerificationDisabledRule) Confidence ¶
func (r *DependencyVerificationDisabledRule) Confidence() float64
func (*DependencyVerificationDisabledRule) Meta ¶
func (r *DependencyVerificationDisabledRule) Meta() api.RuleDescriptor
func (*DependencyVerificationDisabledRule) ModuleAwareNeeds ¶
func (r *DependencyVerificationDisabledRule) ModuleAwareNeeds() 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 ¶
func (r *DependencyWithoutGroupRule) Meta() api.RuleDescriptor
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 ¶
func (r *DeprecatedBlockTagRule) Meta() api.RuleDescriptor
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 ¶
func (r *DeprecatedDependencyRule) Meta() api.RuleDescriptor
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 ¶
func (r *DeprecationRule) Meta() api.RuleDescriptor
type DestructuringDeclarationWithTooManyEntriesRule ¶
type DestructuringDeclarationWithTooManyEntriesRule struct {
FlatDispatchBase
BaseRule
MaxEntries int
}
DestructuringDeclarationWithTooManyEntriesRule limits destructuring entries.
func (*DestructuringDeclarationWithTooManyEntriesRule) Confidence ¶
func (r *DestructuringDeclarationWithTooManyEntriesRule) 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 (*DestructuringDeclarationWithTooManyEntriesRule) Meta ¶
func (r *DestructuringDeclarationWithTooManyEntriesRule) Meta() api.RuleDescriptor
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 ¶
func (r *DeviceAdminManifestRule) Meta() api.RuleDescriptor
type DiCycleDetectionRule ¶
type DiCycleDetectionRule struct {
FlatDispatchBase
BaseRule
}
func (*DiCycleDetectionRule) Confidence ¶
func (r *DiCycleDetectionRule) Confidence() float64
func (*DiCycleDetectionRule) Meta ¶
func (r *DiCycleDetectionRule) Meta() api.RuleDescriptor
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 ¶
func (r *DisableBaselineAlignmentResourceRule) 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 (*DisableBaselineAlignmentResourceRule) Meta ¶
func (r *DisableBaselineAlignmentResourceRule) Meta() api.RuleDescriptor
type DisableCertificatePinningRule ¶
type DisableCertificatePinningRule struct {
FlatDispatchBase
AndroidRule
}
func (*DisableCertificatePinningRule) Confidence ¶
func (r *DisableCertificatePinningRule) Confidence() float64
func (*DisableCertificatePinningRule) Meta ¶
func (r *DisableCertificatePinningRule) Meta() api.RuleDescriptor
type DispatchError ¶
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 ¶
func (d *Dispatcher) Run(file *scanner.File) scanner.FindingColumns
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 ¶
func (r *DocumentationOverPrivateFunctionRule) 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 (*DocumentationOverPrivateFunctionRule) IsFixable ¶
func (r *DocumentationOverPrivateFunctionRule) IsFixable() bool
Comments rules
func (*DocumentationOverPrivateFunctionRule) Meta ¶
func (r *DocumentationOverPrivateFunctionRule) Meta() api.RuleDescriptor
type DocumentationOverPrivatePropertyRule ¶
type DocumentationOverPrivatePropertyRule struct {
FlatDispatchBase
BaseRule
}
DocumentationOverPrivatePropertyRule detects KDoc on private properties.
func (*DocumentationOverPrivatePropertyRule) Confidence ¶
func (r *DocumentationOverPrivatePropertyRule) 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 (*DocumentationOverPrivatePropertyRule) IsFixable ¶
func (r *DocumentationOverPrivatePropertyRule) IsFixable() bool
func (*DocumentationOverPrivatePropertyRule) Meta ¶
func (r *DocumentationOverPrivatePropertyRule) Meta() api.RuleDescriptor
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 ¶
func (r *DontDowncastCollectionTypesRule) Meta() api.RuleDescriptor
type DoubleMutabilityForCollectionRule ¶
type DoubleMutabilityForCollectionRule struct {
FlatDispatchBase
BaseRule
MutableTypes []string
}
--------------------------------------------------------------------------- DoubleMutabilityForCollectionRule detects var with mutable collection type. ---------------------------------------------------------------------------
func (*DoubleMutabilityForCollectionRule) Confidence ¶
func (r *DoubleMutabilityForCollectionRule) Confidence() float64
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 ¶
func (r *DoubleMutabilityForCollectionRule) Meta() api.RuleDescriptor
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 ¶
func (r *DoubleNegativeExpressionRule) Meta() api.RuleDescriptor
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 ¶
func (r *DoubleNegativeLambdaRule) Meta() api.RuleDescriptor
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 ¶
func (r *DrawAllocationRule) Meta() api.RuleDescriptor
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 ¶
func (r *DuplicateActivityManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *DuplicateIDsResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *DuplicateIncludedIDsResourceRule) Meta() api.RuleDescriptor
type DuplicateUsesFeatureManifestRule ¶
type DuplicateUsesFeatureManifestRule struct {
ManifestBase
AndroidRule
}
DuplicateUsesFeatureManifestRule detects <uses-feature> elements with duplicate android:name values.
func (*DuplicateUsesFeatureManifestRule) Meta ¶
func (r *DuplicateUsesFeatureManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *DynamicVersionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ElseCaseInsteadOfExhaustiveWhenRule) Confidence() float64
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 ¶
func (r *ElseCaseInsteadOfExhaustiveWhenRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyCatchBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyClassBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyDefaultConstructorRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyDoWhileBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyElseBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyFinallyBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyForBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyFunctionBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyIfBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyInitBlockRule) Meta() api.RuleDescriptor
type EmptyKotlinFileRule ¶
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 ¶
func (r *EmptyKotlinFileRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptySecondaryConstructorRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyTryBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyWhenBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EmptyWhileBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *EndOfSentenceFormatRule) Meta() api.RuleDescriptor
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 ¶
func (r *EntityMutableColumnRule) Meta() api.RuleDescriptor
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 ¶
func (r *EntityPrimaryKeyNotStableRule) Meta() api.RuleDescriptor
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 ¶
func (r *EqualsAlwaysReturnsTrueOrFalseRule) 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 (*EqualsAlwaysReturnsTrueOrFalseRule) Meta ¶
func (r *EqualsAlwaysReturnsTrueOrFalseRule) Meta() api.RuleDescriptor
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 ¶
func (r *EqualsNullCallRule) Meta() api.RuleDescriptor
type EqualsOnSignatureLineRule ¶
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 ¶
func (r *EqualsOnSignatureLineRule) Meta() api.RuleDescriptor
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 ¶
func (r *EqualsWithHashCodeExistRule) Meta() api.RuleDescriptor
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 ¶
func (r *ErrorUsageWithThrowableRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExceptionRaisedInUnexpectedLocationRule) 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 (*ExceptionRaisedInUnexpectedLocationRule) Meta ¶
func (r *ExceptionRaisedInUnexpectedLocationRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExitOutsideMainRule) Meta() api.RuleDescriptor
type ExplicitCollectionElementAccessMethodRule ¶
type ExplicitCollectionElementAccessMethodRule struct {
FlatDispatchBase
BaseRule
}
func (*ExplicitCollectionElementAccessMethodRule) Confidence ¶
func (r *ExplicitCollectionElementAccessMethodRule) 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 (*ExplicitCollectionElementAccessMethodRule) IsFixable ¶
func (r *ExplicitCollectionElementAccessMethodRule) IsFixable() bool
func (*ExplicitCollectionElementAccessMethodRule) Meta ¶
func (r *ExplicitCollectionElementAccessMethodRule) Meta() api.RuleDescriptor
type ExplicitGarbageCollectionCallRule ¶
type ExplicitGarbageCollectionCallRule struct {
FlatDispatchBase
BaseRule
}
--------------------------------------------------------------------------- ExplicitGarbageCollectionCallRule detects System.gc() calls. ---------------------------------------------------------------------------
func (*ExplicitGarbageCollectionCallRule) Confidence ¶
func (r *ExplicitGarbageCollectionCallRule) 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 (*ExplicitGarbageCollectionCallRule) IsFixable ¶
func (r *ExplicitGarbageCollectionCallRule) IsFixable() bool
func (*ExplicitGarbageCollectionCallRule) Meta ¶
func (r *ExplicitGarbageCollectionCallRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExplicitItLambdaMultipleParametersRule) 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 (*ExplicitItLambdaMultipleParametersRule) IsFixable ¶
func (r *ExplicitItLambdaMultipleParametersRule) IsFixable() bool
ExplicitItLambdaMultipleParameters: naming the replacement parameter requires author intent; not fixable.
func (*ExplicitItLambdaMultipleParametersRule) Meta ¶
func (r *ExplicitItLambdaMultipleParametersRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExplicitItLambdaParameterRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExportedContentProviderRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExportedPreferenceActivityManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExportedReceiverRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExportedServiceManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExportedServiceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExportedWithoutPermissionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExpressionBodySyntaxRule) Meta() api.RuleDescriptor
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 ¶
func (r *ExtraTextResourceRule) Meta() api.RuleDescriptor
type FanInFanOutHotspotRule ¶
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 ¶
func (r *FanInFanOutHotspotRule) Meta() api.RuleDescriptor
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 (r *FieldGetterRule) Meta() api.RuleDescriptor
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 ¶
func (r *FileFromUntrustedPathRule) Meta() api.RuleDescriptor
type FirebaseRemoteConfigDefaultsWithPiiRule ¶
type FirebaseRemoteConfigDefaultsWithPiiRule struct {
FlatDispatchBase
BaseRule
}
FirebaseRemoteConfigDefaultsWithPiiRule flags setDefaults/setDefaultsAsync calls whose map keys match PII patterns.
func (*FirebaseRemoteConfigDefaultsWithPiiRule) Confidence ¶
func (r *FirebaseRemoteConfigDefaultsWithPiiRule) Confidence() float64
func (*FirebaseRemoteConfigDefaultsWithPiiRule) Meta ¶
func (r *FirebaseRemoteConfigDefaultsWithPiiRule) Meta() api.RuleDescriptor
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 ¶
GetV2FixLevel returns the fix level encoded on a rule. Returns (0, false) when the rule is not fixable.
func ParseFixLevel ¶
ParseFixLevel parses a fix level 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 ¶
func (r *FlowWithoutFlowOnRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForEachOnRangeRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenAnnotationRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenClassNameRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenCommentRule) Meta() api.RuleDescriptor
type ForbiddenEntry ¶
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 ¶
func (r *ForbiddenImportRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenMethodCallRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenNamedParamRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenOptInRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenPublicDataClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenSuppressRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForbiddenVoidRule) Meta() api.RuleDescriptor
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 ¶
func (r *ForeignKeyWithoutOnDeleteRule) Meta() api.RuleDescriptor
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 ¶
func (r *FragmentConstructorRule) Meta() api.RuleDescriptor
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 ¶
func (r *FullBackupContentManifestRule) Meta() api.RuleDescriptor
type FunctionComplexity ¶
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 ¶
func (r *FunctionNameMaxLengthRule) Meta() api.RuleDescriptor
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 ¶
func (r *FunctionNameMinLengthRule) Meta() api.RuleDescriptor
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 ¶
func (r *FunctionNamingRule) Meta() api.RuleDescriptor
type FunctionOnlyReturningConstantRule ¶
type FunctionOnlyReturningConstantRule struct {
FlatDispatchBase
BaseRule
ExcludedFunctions []string
IgnoreOverridableFunction bool
IgnoreActualFunction bool
}
FunctionOnlyReturningConstantRule detects functions that only return a constant.
func (*FunctionOnlyReturningConstantRule) Confidence ¶
func (r *FunctionOnlyReturningConstantRule) 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 (*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 ¶
func (r *FunctionOnlyReturningConstantRule) Meta() api.RuleDescriptor
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 ¶
func (r *FunctionParameterNamingRule) Meta() api.RuleDescriptor
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 ¶
func (r *GetInstanceRule) Meta() api.RuleDescriptor
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 ¶
func (r *GetSignaturesRule) Meta() api.RuleDescriptor
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 ¶
func (r *GlobalCoroutineUsageRule) Meta() api.RuleDescriptor
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 ¶
func (r *GlobalScopeLaunchInViewModelRule) Meta() api.RuleDescriptor
type GodClassOrModuleRule ¶
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 ¶
func (r *GodClassOrModuleRule) Meta() api.RuleDescriptor
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 ¶
func (r *GoogleAPIKeyInResourcesRule) Meta() api.RuleDescriptor
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 ¶
func (r *GoogleAppIndexingDeepLinkErrorManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *GoogleAppIndexingWarningManifestRule) Meta() api.RuleDescriptor
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 ¶
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 ¶
func (r *GradleBuildContainsTodoRule) Meta() api.RuleDescriptor
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 ¶
func (r *GradleDeprecatedRule) Meta() api.RuleDescriptor
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 ¶
func (r *GradleGetterRule) Meta() api.RuleDescriptor
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 ¶
func (r *GradleIdeErrorRule) Meta() api.RuleDescriptor
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 ¶
func (r *GradleOldTargetAPIRule) Meta() api.RuleDescriptor
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 ¶
func (r *GradleOverridesManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *GradleOverridesRule) Meta() api.RuleDescriptor
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 ¶
func (r *GradlePluginCompatibilityRule) Meta() api.RuleDescriptor
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 (r *GradleWrapperValidationActionRule) Confidence() float64
func (*GradleWrapperValidationActionRule) Meta ¶
func (r *GradleWrapperValidationActionRule) Meta() api.RuleDescriptor
func (*GradleWrapperValidationActionRule) ModuleAwareNeeds ¶
func (r *GradleWrapperValidationActionRule) ModuleAwareNeeds() 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 ¶
func (r *GrantAllUrisRule) Meta() api.RuleDescriptor
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 ¶
func (r *GsonPolymorphicFromJSONRule) Meta() api.RuleDescriptor
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 ¶
func (r *HTTPClientNotReusedRule) Meta() api.RuleDescriptor
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 (r *HandlerLeakRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedAwsAccessKeyRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedBearerTokenRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedDateFormatRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedEnvironmentNameRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedGcpServiceAccountRule) Meta() api.RuleDescriptor
type HardcodedHTTPURLRule ¶
type HardcodedHTTPURLRule struct {
FlatDispatchBase
AndroidRule
}
func (*HardcodedHTTPURLRule) Confidence ¶
func (r *HardcodedHTTPURLRule) Confidence() float64
func (*HardcodedHTTPURLRule) Meta ¶
func (r *HardcodedHTTPURLRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedJwtRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedLocalhostURLRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedLogTagRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedNumberFormatRule) Meta() api.RuleDescriptor
type HardcodedSecretKeyRule ¶
type HardcodedSecretKeyRule struct {
FlatDispatchBase
AndroidRule
}
func (*HardcodedSecretKeyRule) Confidence ¶
func (r *HardcodedSecretKeyRule) Confidence() float64
func (*HardcodedSecretKeyRule) Meta ¶
func (r *HardcodedSecretKeyRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedTextRule) Meta() api.RuleDescriptor
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 ¶
func (r *HardcodedValuesResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *HasPlatformTypeRule) Meta() api.RuleDescriptor
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 ¶
func (r *HiltEntryPointOnNonInterfaceRule) Meta() api.RuleDescriptor
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 ¶
func (r *HiltInstallInMismatchRule) Meta() api.RuleDescriptor
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 ¶
func (r *HiltSingletonWithActivityDepRule) Meta() api.RuleDescriptor
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 ¶
func (r *IconDensitiesRule) Meta() api.RuleDescriptor
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 ¶
func (r *IconDipSizeRule) Meta() api.RuleDescriptor
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 ¶
func (r *IconDuplicatesConfigRule) Meta() api.RuleDescriptor
type IconDuplicatesRule ¶
type IconDuplicatesRule struct {
IconResourceBase
AndroidRule
}
IconDuplicatesRule detects identical images across densities.
func (*IconDuplicatesRule) Confidence ¶
func (r *IconDuplicatesRule) Confidence() float64
func (*IconDuplicatesRule) Meta ¶
func (r *IconDuplicatesRule) Meta() api.RuleDescriptor
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 ¶
func (r *IconExpectedSizeRule) Meta() api.RuleDescriptor
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 ¶
func (r *IconExtensionRule) Meta() api.RuleDescriptor
type IconLauncherShapeRule ¶
type IconLauncherShapeRule struct {
IconResourceBase
AndroidRule
}
IconLauncherShapeRule checks launcher icon shape transparency.
func (*IconLauncherShapeRule) Confidence ¶
func (r *IconLauncherShapeRule) Confidence() float64
func (*IconLauncherShapeRule) Meta ¶
func (r *IconLauncherShapeRule) Meta() api.RuleDescriptor
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 ¶
func (r *IconLocationRule) Meta() api.RuleDescriptor
type IconMissingDensityFolderRule ¶
type IconMissingDensityFolderRule struct {
IconResourceBase
AndroidRule
}
IconMissingDensityFolderRule detects missing density folders.
func (*IconMissingDensityFolderRule) Confidence ¶
func (r *IconMissingDensityFolderRule) Confidence() float64
func (*IconMissingDensityFolderRule) Meta ¶
func (r *IconMissingDensityFolderRule) Meta() api.RuleDescriptor
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 ¶
func (r *IconMixedNinePatchRule) Meta() api.RuleDescriptor
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 ¶
func (r *IconXMLAndPngRule) Meta() api.RuleDescriptor
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 ¶
func (r *IgnoredReturnValueRule) Meta() api.RuleDescriptor
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 ¶
func (r *IllegalResourceRefResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ImageLoadedAtFullSizeInListRule) Meta() api.RuleDescriptor
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 ¶
func (r *ImageLoaderNoMemoryCacheRule) Meta() api.RuleDescriptor
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 ¶
func (r *ImplicitDefaultLocaleRule) Meta() api.RuleDescriptor
type ImplicitPendingIntentRule ¶
type ImplicitPendingIntentRule struct {
FlatDispatchBase
AndroidRule
}
func (*ImplicitPendingIntentRule) Confidence ¶
func (r *ImplicitPendingIntentRule) Confidence() float64
func (*ImplicitPendingIntentRule) Meta ¶
func (r *ImplicitPendingIntentRule) Meta() api.RuleDescriptor
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 ¶
func (r *ImplicitUnitReturnTypeRule) Meta() api.RuleDescriptor
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 ¶
func (r *ImpliedQuantityResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *InOrMmUsageResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *IncludeLayoutParamResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *InconsistentArraysResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *InconsistentLayoutResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *InefficientWeightResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *InjectDispatcherRule) Meta() api.RuleDescriptor
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 ¶
func (r *InjectOnAbstractClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *InnerclassSeparatorRule) Meta() api.RuleDescriptor
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 ¶
func (r *InsecureBaseConfigurationManifestRule) Meta() api.RuleDescriptor
type InsecureTrustManagerRule ¶
type InsecureTrustManagerRule struct {
FlatDispatchBase
AndroidRule
}
func (*InsecureTrustManagerRule) Confidence ¶
func (r *InsecureTrustManagerRule) Confidence() float64
func (*InsecureTrustManagerRule) Meta ¶
func (r *InsecureTrustManagerRule) Meta() api.RuleDescriptor
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 ¶
func (r *InstanceOfCheckForExceptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *InstantiatableRule) Meta() api.RuleDescriptor
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 ¶
func (r *IntentFilterExportRequiredRule) Meta() api.RuleDescriptor
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 ¶
func (r *IntoMapDuplicateKeyRule) Meta() api.RuleDescriptor
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 ¶
func (r *IntoMapMissingKeyRule) Meta() api.RuleDescriptor
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 ¶
func (r *IntoSetDuplicateTypeRule) Meta() api.RuleDescriptor
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 ¶
func (r *IntoSetOnNonSetReturnRule) Meta() api.RuleDescriptor
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 ¶
func (r *InvalidIDResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *InvalidPackageDeclarationRule) Meta() api.RuleDescriptor
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 ¶
func (r *InvalidRangeRule) Meta() api.RuleDescriptor
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 ¶
func (r *InvalidResourceFolderResourceRule) 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 (*InvalidResourceFolderResourceRule) Meta ¶
func (r *InvalidResourceFolderResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *InvalidUsesTagAttributeManifestRule) Meta() api.RuleDescriptor
type IteratorHasNextCallsNextMethodRule ¶
type IteratorHasNextCallsNextMethodRule struct {
FlatDispatchBase
BaseRule
}
--------------------------------------------------------------------------- IteratorHasNextCallsNextMethodRule detects hasNext() calling next(). ---------------------------------------------------------------------------
func (*IteratorHasNextCallsNextMethodRule) Confidence ¶
func (r *IteratorHasNextCallsNextMethodRule) 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 (*IteratorHasNextCallsNextMethodRule) Meta ¶
func (r *IteratorHasNextCallsNextMethodRule) Meta() api.RuleDescriptor
type IteratorNotThrowingNoSuchElementExceptionRule ¶
type IteratorNotThrowingNoSuchElementExceptionRule struct {
FlatDispatchBase
BaseRule
}
--------------------------------------------------------------------------- IteratorNotThrowingNoSuchElementExceptionRule detects next() without throw. ---------------------------------------------------------------------------
func (*IteratorNotThrowingNoSuchElementExceptionRule) Confidence ¶
func (r *IteratorNotThrowingNoSuchElementExceptionRule) 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 (*IteratorNotThrowingNoSuchElementExceptionRule) Meta ¶
func (r *IteratorNotThrowingNoSuchElementExceptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *JacksonDefaultTypingRule) Meta() api.RuleDescriptor
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 ¶
func (r *JavaObjectInputStreamRule) Meta() api.RuleDescriptor
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 ¶
func (r *JdbcPreparedStatementNotClosedRule) 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 (*JdbcPreparedStatementNotClosedRule) Meta ¶
func (r *JdbcPreparedStatementNotClosedRule) Meta() api.RuleDescriptor
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 ¶
func (r *JdbcResultSetLeakedFromFunctionRule) 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 (*JdbcResultSetLeakedFromFunctionRule) Meta ¶
func (r *JdbcResultSetLeakedFromFunctionRule) Meta() api.RuleDescriptor
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 ¶
func (r *JdbcStatementExecuteRule) Meta() api.RuleDescriptor
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 ¶
func (r *JvmTargetMismatchRule) Meta() api.RuleDescriptor
type KDocReferencesNonPublicPropertyRule ¶
type KDocReferencesNonPublicPropertyRule struct {
FlatDispatchBase
BaseRule
}
KDocReferencesNonPublicPropertyRule finds KDoc [ref] to non-public properties.
func (*KDocReferencesNonPublicPropertyRule) Confidence ¶
func (r *KDocReferencesNonPublicPropertyRule) 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 (*KDocReferencesNonPublicPropertyRule) Meta ¶
func (r *KDocReferencesNonPublicPropertyRule) Meta() api.RuleDescriptor
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 ¶
func (r *KdocLinkValidationRule) Meta() api.RuleDescriptor
type KotlinVersionMismatchAcrossModulesRule ¶
type KotlinVersionMismatchAcrossModulesRule struct {
BaseRule
}
KotlinVersionMismatchAcrossModulesRule flags modules with divergent Kotlin JVM targets.
func (*KotlinVersionMismatchAcrossModulesRule) Confidence ¶
func (r *KotlinVersionMismatchAcrossModulesRule) Confidence() float64
func (*KotlinVersionMismatchAcrossModulesRule) Meta ¶
func (r *KotlinVersionMismatchAcrossModulesRule) Meta() api.RuleDescriptor
func (*KotlinVersionMismatchAcrossModulesRule) ModuleAwareNeeds ¶
func (r *KotlinVersionMismatchAcrossModulesRule) ModuleAwareNeeds() 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 ¶
func (r *LabelForResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *LabeledExpressionRule) Meta() api.RuleDescriptor
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 ¶
func (r *LambdaParameterNamingRule) Meta() api.RuleDescriptor
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 ¶
func (r *LateinitUsageRule) Meta() api.RuleDescriptor
type LaunchWithoutCoroutineExceptionHandlerRule ¶
type LaunchWithoutCoroutineExceptionHandlerRule struct {
FlatDispatchBase
BaseRule
}
LaunchWithoutCoroutineExceptionHandlerRule detects launch{} with throw but no handler.
func (*LaunchWithoutCoroutineExceptionHandlerRule) Confidence ¶
func (r *LaunchWithoutCoroutineExceptionHandlerRule) Confidence() float64
func (*LaunchWithoutCoroutineExceptionHandlerRule) Meta ¶
func (r *LaunchWithoutCoroutineExceptionHandlerRule) Meta() api.RuleDescriptor
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 ¶
func (r *LayerDependencyViolationRule) Meta() api.RuleDescriptor
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 ¶
func (r *LayoutAutofillHintMismatchRule) Meta() api.RuleDescriptor
type LayoutClickableWithoutMinSizeRule ¶
type LayoutClickableWithoutMinSizeRule struct {
LayoutResourceBase
AndroidRule
}
func (*LayoutClickableWithoutMinSizeRule) Confidence ¶
func (r *LayoutClickableWithoutMinSizeRule) Confidence() float64
func (*LayoutClickableWithoutMinSizeRule) Meta ¶
func (r *LayoutClickableWithoutMinSizeRule) Meta() api.RuleDescriptor
type LayoutEditTextMissingImportanceRule ¶
type LayoutEditTextMissingImportanceRule struct {
LayoutResourceBase
AndroidRule
}
func (*LayoutEditTextMissingImportanceRule) Confidence ¶
func (r *LayoutEditTextMissingImportanceRule) Confidence() float64
func (*LayoutEditTextMissingImportanceRule) Meta ¶
func (r *LayoutEditTextMissingImportanceRule) Meta() api.RuleDescriptor
type LayoutImportantForAccessibilityNoRule ¶
type LayoutImportantForAccessibilityNoRule struct {
LayoutResourceBase
AndroidRule
}
func (*LayoutImportantForAccessibilityNoRule) Confidence ¶
func (r *LayoutImportantForAccessibilityNoRule) Confidence() float64
func (*LayoutImportantForAccessibilityNoRule) Meta ¶
func (r *LayoutImportantForAccessibilityNoRule) Meta() api.RuleDescriptor
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 (r *LayoutInflationRule) Meta() api.RuleDescriptor
func (*LayoutInflationRule) NodeTypes ¶
func (r *LayoutInflationRule) NodeTypes() []string
type LayoutMinTouchTargetInButtonRowRule ¶
type LayoutMinTouchTargetInButtonRowRule struct {
LayoutResourceBase
AndroidRule
}
func (*LayoutMinTouchTargetInButtonRowRule) Confidence ¶
func (r *LayoutMinTouchTargetInButtonRowRule) Confidence() float64
func (*LayoutMinTouchTargetInButtonRowRule) Meta ¶
func (r *LayoutMinTouchTargetInButtonRowRule) Meta() api.RuleDescriptor
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 ¶
func (r *LazyColumnInsideColumnRule) Meta() api.RuleDescriptor
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 ¶
func (r *LazyInsteadOfDirectRule) Meta() api.RuleDescriptor
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 ¶
func (r *LibraryCodeMustSpecifyReturnTypeRule) 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 (*LibraryCodeMustSpecifyReturnTypeRule) Meta ¶
func (r *LibraryCodeMustSpecifyReturnTypeRule) Meta() api.RuleDescriptor
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 ¶
func (r *LibraryCustomViewRule) Meta() api.RuleDescriptor
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 ¶
func (r *LibraryEntitiesShouldNotBePublicRule) 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 (*LibraryEntitiesShouldNotBePublicRule) Meta ¶
func (r *LibraryEntitiesShouldNotBePublicRule) Meta() api.RuleDescriptor
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 ¶
func (r *LocalSuppressRule) Meta() api.RuleDescriptor
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 ¶
func (r *LocaleConfigMissingRule) Meta() api.RuleDescriptor
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 ¶
func (r *LocaleConfigStaleResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *LocaleDefaultForCurrencyRule) Meta() api.RuleDescriptor
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 ¶
func (r *LocaleFolderRule) Meta() api.RuleDescriptor
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 ¶
func (r *LocaleGetDefaultForFormattingRule) Confidence() float64
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 (r *LocationBackgroundWithoutRationaleRule) Confidence() float64
func (*LocationBackgroundWithoutRationaleRule) Meta ¶
func (r *LocationBackgroundWithoutRationaleRule) Meta() api.RuleDescriptor
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 ¶
func (r *LogDetectorRule) Meta() api.RuleDescriptor
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 ¶
func (r *LogLevelGuardMissingRule) Meta() api.RuleDescriptor
type LogOfSharedPreferenceReadRule ¶
type LogOfSharedPreferenceReadRule struct {
}
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 ¶
func (r *LogOfSharedPreferenceReadRule) Meta() api.RuleDescriptor
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 ¶
func (r *LogTagLengthRule) Meta() api.RuleDescriptor
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 ¶
func (r *LogTagMismatchRule) Meta() api.RuleDescriptor
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 ¶
func (r *LogWithoutCorrelationIDRule) Meta() api.RuleDescriptor
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 ¶
func (r *LoggerInterpolatedMessageRule) Meta() api.RuleDescriptor
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 ¶
func (r *LoggerStringConcatRule) Meta() api.RuleDescriptor
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 ¶
func (r *LoggerWithoutLoggerFieldRule) Meta() api.RuleDescriptor
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 ¶
func (r *LongParameterListRule) Meta() api.RuleDescriptor
type LoopWithTooManyJumpStatementsRule ¶
type LoopWithTooManyJumpStatementsRule struct {
FlatDispatchBase
BaseRule
MaxJumps int
}
LoopWithTooManyJumpStatementsRule limits break/continue in loops.
func (*LoopWithTooManyJumpStatementsRule) Confidence ¶
func (r *LoopWithTooManyJumpStatementsRule) 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 (*LoopWithTooManyJumpStatementsRule) Meta ¶
func (r *LoopWithTooManyJumpStatementsRule) Meta() api.RuleDescriptor
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 ¶
func (r *MagicNumberRule) Meta() api.RuleDescriptor
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 (r *MainDispatcherInLibraryCodeRule) Meta() api.RuleDescriptor
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 ¶
func (r *MandatoryBracesLoopsRule) Meta() api.RuleDescriptor
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 ¶
func (r *MangledCRLFRule) Meta() api.RuleDescriptor
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 ManifestElement ¶
type ManifestMetaData ¶
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 ¶
func (r *ManifestOrderManifestRule) Meta() api.RuleDescriptor
type ManifestTypoRule ¶
type ManifestTypoRule struct {
ManifestBase
AndroidRule
}
ManifestTypoRule detects common typos in manifest element names.
func (*ManifestTypoRule) Meta ¶
func (r *ManifestTypoRule) Meta() api.RuleDescriptor
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 ¶
func (r *MapGetWithNotNullAssertionRule) Meta() api.RuleDescriptor
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 ¶
func (r *MatchingDeclarationNameRule) Meta() api.RuleDescriptor
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 ¶
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 ¶
func (r *MaxChainedCallsOnSameLineRule) Meta() api.RuleDescriptor
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 ¶
func (r *MaxLineLengthRule) Meta() api.RuleDescriptor
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 ¶
func (r *MayBeConstantRule) Meta() api.RuleDescriptor
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 ¶
func (r *MdcAcrossCoroutineBoundaryRule) Meta() api.RuleDescriptor
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 ¶
func (r *MdcPutNoRemoveRule) Meta() api.RuleDescriptor
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 ¶
func (r *MemberNameEqualsClassNameRule) Meta() api.RuleDescriptor
type MergeConflictMarkerLeftoverRule ¶
MergeConflictMarkerLeftoverRule flags unresolved merge conflict markers.
func (*MergeConflictMarkerLeftoverRule) Confidence ¶
func (r *MergeConflictMarkerLeftoverRule) Confidence() float64
func (*MergeConflictMarkerLeftoverRule) Meta ¶
func (r *MergeConflictMarkerLeftoverRule) Meta() api.RuleDescriptor
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 ¶
func (r *MergeRootFrameResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *MethodOverloadingRule) Meta() api.RuleDescriptor
type MetricCounterNotMonotonicRule ¶
type MetricCounterNotMonotonicRule struct {
FlatDispatchBase
BaseRule
}
MetricCounterNotMonotonicRule detects negative counter increments.
func (*MetricCounterNotMonotonicRule) Confidence ¶
func (r *MetricCounterNotMonotonicRule) Confidence() float64
func (*MetricCounterNotMonotonicRule) Meta ¶
func (r *MetricCounterNotMonotonicRule) Meta() api.RuleDescriptor
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 ¶
func (r *MetricNameMissingUnitRule) Meta() api.RuleDescriptor
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 ¶
func (r *MetricTagHighCardinalityRule) Meta() api.RuleDescriptor
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 ¶
func (r *MetricTimerOutsideBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *MetroFactoryDeclarationShapeRule) Meta() api.RuleDescriptor
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 ¶
func (r *MinSdkTooLowRule) Meta() api.RuleDescriptor
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 ¶
func (r *MipmapLauncherRule) Meta() api.RuleDescriptor
type MissingApplicationIconRule ¶
type MissingApplicationIconRule struct {
ManifestBase
AndroidRule
}
MissingApplicationIconRule checks that the <application> element has android:icon set.
func (*MissingApplicationIconRule) Meta ¶
func (r *MissingApplicationIconRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingContentDescriptionResourceRule) 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 (*MissingContentDescriptionResourceRule) Meta ¶
func (r *MissingContentDescriptionResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingExportedFlagRule) Meta() api.RuleDescriptor
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 (r *MissingGradleChecksumsRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingIDResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingJvmSuppressWildcardsRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingLeanbackLauncherManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingLeanbackSupportManifestRule) Meta() api.RuleDescriptor
type MissingPackageDeclarationRule ¶
--------------------------------------------------------------------------- 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 ¶
func (r *MissingPackageDeclarationRule) Meta() api.RuleDescriptor
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 (r *MissingPermissionRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingPrefixResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingQuantityResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingRegisteredManifestRule) Meta() api.RuleDescriptor
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 ¶
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 ¶
func (r *MissingSuperCallRule) Meta() api.RuleDescriptor
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 ¶
func (r *MissingUseCallRule) Meta() api.RuleDescriptor
type MissingVersionManifestRule ¶
type MissingVersionManifestRule struct {
ManifestBase
AndroidRule
}
MissingVersionManifestRule detects missing android:versionCode or android:versionName on the <manifest> element.
func (*MissingVersionManifestRule) Meta ¶
func (r *MissingVersionManifestRule) Meta() api.RuleDescriptor
type MixedAssertionLibrariesRule ¶
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 ¶
func (r *MixedAssertionLibrariesRule) Meta() api.RuleDescriptor
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 ¶
func (r *MockLocationManifestRule) Meta() api.RuleDescriptor
type MockWithoutVerifyRule ¶
type MockWithoutVerifyRule struct {
FlatDispatchBase
BaseRule
}
func (*MockWithoutVerifyRule) Confidence ¶
func (r *MockWithoutVerifyRule) Confidence() float64
func (*MockWithoutVerifyRule) Meta ¶
func (r *MockWithoutVerifyRule) Meta() api.RuleDescriptor
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 ¶
func (r *ModifierOrderRule) Meta() api.RuleDescriptor
type ModuleAwareNeeds ¶
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 (r *ModuleTemplateConformanceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ModuleWithNonStaticProvidesRule) Meta() api.RuleDescriptor
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 ¶
func (r *MultilineLambdaItParameterRule) Meta() api.RuleDescriptor
type MultilineRawStringIndentationRule ¶
type MultilineRawStringIndentationRule struct {
FlatDispatchBase
BaseRule
IndentSize int
TrimmingMethods []string
}
MultilineRawStringIndentationRule checks raw string indentation.
func (*MultilineRawStringIndentationRule) Confidence ¶
func (r *MultilineRawStringIndentationRule) 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 (*MultilineRawStringIndentationRule) Meta ¶
func (r *MultilineRawStringIndentationRule) Meta() api.RuleDescriptor
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 ¶
func (r *MultipleUsesSdkManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *MutableStateInObjectRule) Meta() api.RuleDescriptor
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 ¶
func (r *NamedArgumentsRule) Meta() api.RuleDescriptor
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 ¶
func (r *NamespaceTypoResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *NegativeMarginResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *NestedBlockDepthRule) Meta() api.RuleDescriptor
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 ¶
func (r *NestedClassesVisibilityRule) Meta() api.RuleDescriptor
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 ¶
func (r *NestedScopeFunctionsRule) Meta() api.RuleDescriptor
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 ¶
func (r *NestedScrollingResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *NestedScrollingRule) Meta() api.RuleDescriptor
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 ¶
func (r *NestedWeightsResourceRule) Meta() api.RuleDescriptor
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 (r *NetworkSecurityConfigDebugOverridesRule) Confidence() float64
func (*NetworkSecurityConfigDebugOverridesRule) Meta ¶
func (r *NetworkSecurityConfigDebugOverridesRule) Meta() api.RuleDescriptor
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 ¶
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 ¶
func (r *NewLineAtEndOfFileRule) Meta() api.RuleDescriptor
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 ¶
func (r *NewerVersionAvailableRule) Meta() api.RuleDescriptor
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 ¶
func (r *NfcTechWhitespaceRule) Meta() api.RuleDescriptor
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 ¶
func (r *NoNameShadowingRule) Meta() api.RuleDescriptor
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 ¶
func (r *NonASCIIIdentifierRule) Meta() api.RuleDescriptor
type NonBooleanPropertyPrefixedWithIsRule ¶
type NonBooleanPropertyPrefixedWithIsRule struct {
FlatDispatchBase
BaseRule
}
NonBooleanPropertyPrefixedWithIsRule flags non-Boolean properties that start with "is".
func (*NonBooleanPropertyPrefixedWithIsRule) Confidence ¶
func (r *NonBooleanPropertyPrefixedWithIsRule) 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 (*NonBooleanPropertyPrefixedWithIsRule) Meta ¶
func (r *NonBooleanPropertyPrefixedWithIsRule) Meta() api.RuleDescriptor
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 ¶
func (r *NonInternationalizedSmsRule) Meta() api.RuleDescriptor
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 ¶
func (r *NotImplementedDeclarationRule) Meta() api.RuleDescriptor
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 ¶
func (r *NotSiblingResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *NullCheckOnMutablePropertyRule) Meta() api.RuleDescriptor
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 ¶
func (r *NullableBooleanCheckRule) Meta() api.RuleDescriptor
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 ¶
func (r *NullableStructuredFieldRule) Meta() api.RuleDescriptor
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 (r *NullableToStringCallRule) Meta() api.RuleDescriptor
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 ¶
func (r *ObjectAnimatorBindingRule) Meta() api.RuleDescriptor
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 ¶
func (r *ObjectExtendsThrowableRule) Meta() api.RuleDescriptor
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 ¶
func (r *ObjectLiteralToLambdaRule) Meta() api.RuleDescriptor
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 ¶
func (r *ObjectPropertyNamingRule) Meta() api.RuleDescriptor
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 ¶
func (r *ObsoleteLayoutParamsResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ObsoleteLayoutParamsRule) Meta() api.RuleDescriptor
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 ¶
func (r *OkHTTPCallExecuteSyncRule) Meta() api.RuleDescriptor
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 ¶
func (r *OkHTTPClientCreatedPerCallRule) Meta() api.RuleDescriptor
type OkHTTPDisableSslValidationRule ¶
type OkHTTPDisableSslValidationRule struct {
FlatDispatchBase
AndroidRule
}
func (*OkHTTPDisableSslValidationRule) Confidence ¶
func (r *OkHTTPDisableSslValidationRule) Confidence() float64
func (*OkHTTPDisableSslValidationRule) Meta ¶
func (r *OkHTTPDisableSslValidationRule) Meta() api.RuleDescriptor
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 ¶
func (r *OnClickResourceRule) Meta() api.RuleDescriptor
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 (r *OpenForTestingCallerInNonTestRule) Confidence() float64
func (*OpenForTestingCallerInNonTestRule) Meta ¶
func (r *OpenForTestingCallerInNonTestRule) Meta() api.RuleDescriptor
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 ¶
func (r *OptionalAbstractKeywordRule) Meta() api.RuleDescriptor
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 ¶
func (r *OptionalUnitRule) Meta() api.RuleDescriptor
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 ¶
func (r *OrientationResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *OssLicensesNotIncludedInAndroidRule) Confidence() float64
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 ¶
func (r *OutdatedDocumentationRule) Meta() api.RuleDescriptor
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 ¶
func (r *OverdrawResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *OverrideAbstractRule) Meta() api.RuleDescriptor
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 (r *PackageDependencyCycleRule) Meta() api.RuleDescriptor
func (*PackageDependencyCycleRule) ModuleAwareNeeds ¶
func (r *PackageDependencyCycleRule) ModuleAwareNeeds() ModuleAwareNeeds
type PackageDependencyEdge ¶
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 ¶
func (r *PackageNamingConventionDriftRule) Meta() api.RuleDescriptor
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 ¶
func (r *PackageNamingRule) Meta() api.RuleDescriptor
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 ¶
func (r *ParcelCreatorRule) Meta() api.RuleDescriptor
type PeriodicWorkRequestLessThan15MinRule ¶
type PeriodicWorkRequestLessThan15MinRule struct {
FlatDispatchBase
BaseRule
}
PeriodicWorkRequestLessThan15MinRule detects PeriodicWorkRequestBuilder with an interval less than 15 minutes.
func (*PeriodicWorkRequestLessThan15MinRule) Confidence ¶
func (r *PeriodicWorkRequestLessThan15MinRule) Confidence() float64
func (*PeriodicWorkRequestLessThan15MinRule) Meta ¶
func (r *PeriodicWorkRequestLessThan15MinRule) Meta() api.RuleDescriptor
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 ¶
func (r *PermissionImpliesUnsupportedHardwareManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *PlainFileWriteOfSensitiveRule) Meta() api.RuleDescriptor
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 ¶
func (r *PluralsCandidateRule) Meta() api.RuleDescriptor
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.
func V2RulePrecision ¶
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 ¶
func (r *PrintStackTraceInProductionRule) Meta() api.RuleDescriptor
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 ¶
func (r *PrintStackTraceRule) Meta() api.RuleDescriptor
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 ¶
func (r *PrintlnInProductionRule) Meta() api.RuleDescriptor
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 ¶
func (r *PrngFromSystemTimeRule) Meta() api.RuleDescriptor
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 ¶
func (r *ProcessBuilderShellArgRule) Meta() api.RuleDescriptor
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 ¶
func (r *ProguardSplitRule) Meta() api.RuleDescriptor
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 ¶
func (r *PropertyEscapeRule) Meta() api.RuleDescriptor
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 ¶
func (r *PropertyUsedBeforeDeclarationRule) 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 (*PropertyUsedBeforeDeclarationRule) Meta ¶
func (r *PropertyUsedBeforeDeclarationRule) Meta() api.RuleDescriptor
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 ¶
func (r *ProtectedMemberInFinalClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *ProtectedPermissionsManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *ProviderInsteadOfLazyRule) Meta() api.RuleDescriptor
type PublicToInternalLeakyAbstractionRule ¶
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 ¶
func (r *PublicToInternalLeakyAbstractionRule) Confidence() float64
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 ¶
func (r *PublicToInternalLeakyAbstractionRule) Meta() api.RuleDescriptor
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 ¶
func (r *PxUsageResourceRule) Meta() api.RuleDescriptor
type RangeRule ¶
type RangeRule struct {
FlatDispatchBase
AndroidRule
}
func (*RangeRule) Confidence ¶
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
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 ¶
func (r *RangeUntilInsteadOfRangeToRule) Meta() api.RuleDescriptor
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 (r *RecyclerAdapterStableIDsDefaultRule) Confidence() float64
func (*RecyclerAdapterStableIDsDefaultRule) Meta ¶
func (r *RecyclerAdapterStableIDsDefaultRule) Meta() api.RuleDescriptor
type RecyclerAdapterWithoutDiffUtilRule ¶
type RecyclerAdapterWithoutDiffUtilRule struct {
FlatDispatchBase
BaseRule
}
RecyclerAdapterWithoutDiffUtilRule detects RecyclerView.Adapter subclasses using notifyDataSetChanged() without DiffUtil or ListAdapter.
func (*RecyclerAdapterWithoutDiffUtilRule) Confidence ¶
func (r *RecyclerAdapterWithoutDiffUtilRule) Confidence() float64
func (*RecyclerAdapterWithoutDiffUtilRule) Meta ¶
func (r *RecyclerAdapterWithoutDiffUtilRule) Meta() api.RuleDescriptor
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 ¶
func (r *RecyclerViewInLazyColumnRule) Meta() api.RuleDescriptor
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 ¶
func (r *RedundantConstructorKeywordRule) Meta() api.RuleDescriptor
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 ¶
func (r *RedundantExplicitTypeRule) Meta() api.RuleDescriptor
type RedundantHigherOrderMapUsageRule ¶
type RedundantHigherOrderMapUsageRule struct {
FlatDispatchBase
BaseRule
}
RedundantHigherOrderMapUsageRule detects .map { it } (identity map).
func (*RedundantHigherOrderMapUsageRule) IsFixable ¶
func (r *RedundantHigherOrderMapUsageRule) IsFixable() bool
func (*RedundantHigherOrderMapUsageRule) Meta ¶
func (r *RedundantHigherOrderMapUsageRule) Meta() api.RuleDescriptor
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 ¶
func (r *RedundantSuspendModifierRule) Meta() api.RuleDescriptor
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 ¶
func (r *RedundantVisibilityModifierRule) Meta() api.RuleDescriptor
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 ¶
func (r *RelativeOverlapResourceRule) Meta() api.RuleDescriptor
type RelaxedMockUsedForValueClassRule ¶
type RelaxedMockUsedForValueClassRule struct {
FlatDispatchBase
BaseRule
}
func (*RelaxedMockUsedForValueClassRule) Confidence ¶
func (r *RelaxedMockUsedForValueClassRule) Confidence() float64
func (*RelaxedMockUsedForValueClassRule) Meta ¶
func (r *RelaxedMockUsedForValueClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *RemoteVersionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ReplaceSafeCallChainWithRunRule) Meta() api.RuleDescriptor
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 ¶
func (r *RequiredSizeResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ResAutoResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ResourceAsColorRule) Meta() api.RuleDescriptor
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 ¶
func (r *ResourceNameRule) Meta() api.RuleDescriptor
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 ¶
func (r *ResourceTypeRule) Meta() api.RuleDescriptor
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 ¶
func (r *RethrowCaughtExceptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *RetrofitCreateInHotPathRule) Meta() api.RuleDescriptor
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 ¶
func (r *ReturnCountRule) Meta() api.RuleDescriptor
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 ¶
func (r *ReturnFromFinallyRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomConflictStrategyReplaceOnFkRule) Confidence() float64
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 ¶
func (r *RoomConflictStrategyReplaceOnFkRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomDatabaseVersionNotBumpedRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomEntityChangedMigrationMissingRule) Confidence() float64
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 ¶
func (r *RoomEntityChangedMigrationMissingRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomExportSchemaDisabledRule) Meta() api.RuleDescriptor
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 (r *RoomFallbackToDestructiveMigrationRule) Confidence() float64
func (*RoomFallbackToDestructiveMigrationRule) Meta ¶
func (r *RoomFallbackToDestructiveMigrationRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomFlowQueryWithoutDistinctRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomLoadsAllWhereFirstUsedRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomMigrationUsesExecSQLWithInterpolationRule) Confidence() float64
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 ¶
func (r *RoomMigrationUsesExecSQLWithInterpolationRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomMultipleWritesMissingTransactionRule) Confidence() float64
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 ¶
func (r *RoomMultipleWritesMissingTransactionRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomQueryMissingWhereForUpdateRule) Confidence() float64
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 ¶
func (r *RoomQueryMissingWhereForUpdateRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomQueryWithLikeMissingEscapeRule) Confidence() float64
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 ¶
func (r *RoomQueryWithLikeMissingEscapeRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomRawQueryStringConcatRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomRelationWithoutIndexRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomSelectStarWithoutLimitRule) Meta() api.RuleDescriptor
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 ¶
func (r *RoomSuspendQueryInTransactionRule) Confidence() float64
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 ¶
func (r *RoomSuspendQueryInTransactionRule) Meta() api.RuleDescriptor
type RsaNoPaddingRule ¶
type RsaNoPaddingRule struct {
FlatDispatchBase
AndroidRule
}
func (*RsaNoPaddingRule) Confidence ¶
func (r *RsaNoPaddingRule) Confidence() float64
func (*RsaNoPaddingRule) Meta ¶
func (r *RsaNoPaddingRule) Meta() api.RuleDescriptor
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 ¶
func (r *RtlCompatManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *RtlEnabledManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *RtlFieldAccessRule) Meta() api.RuleDescriptor
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 ¶
func (r *RtlHardcodedResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *RtlSuperscriptResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *RtlSymmetryResourceRule) Meta() api.RuleDescriptor
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"`
}
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 ¶
func (r *RunBlockingInTestRule) Meta() api.RuleDescriptor
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 ¶
func (r *RunTestWithDelayRule) Meta() api.RuleDescriptor
type RunTestWithThreadSleepRule ¶
type RunTestWithThreadSleepRule struct {
FlatDispatchBase
BaseRule
}
func (*RunTestWithThreadSleepRule) Confidence ¶
func (r *RunTestWithThreadSleepRule) Confidence() float64
func (*RunTestWithThreadSleepRule) Meta ¶
func (r *RunTestWithThreadSleepRule) Meta() api.RuleDescriptor
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 ¶
func (r *RuntimeExecUnsafeShapeRule) Meta() api.RuleDescriptor
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 ¶
func (r *SQLInjectionRawQueryRule) Meta() api.RuleDescriptor
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 ¶
func (r *SQLiteStringRule) Meta() api.RuleDescriptor
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 ¶
func (r *SampleAnnotationFreshnessRule) Meta() api.RuleDescriptor
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 ¶
func (r *ScopeOnParameterizedClassRule) Meta() api.RuleDescriptor
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 (r *ScreenshotNotBlockedOnLoginScreenRule) Confidence() float64
func (*ScreenshotNotBlockedOnLoginScreenRule) Meta ¶
func (r *ScreenshotNotBlockedOnLoginScreenRule) Meta() api.RuleDescriptor
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 ¶
func (r *ScrollViewCountResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *ScrollViewCountRule) Meta() api.RuleDescriptor
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 ¶
func (r *ScrollViewSizeResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *SecureRandomRule) Meta() api.RuleDescriptor
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 ¶
func (r *SerialVersionUIDInSerializableClassRule) Confidence() float64
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 ¶
func (r *SerialVersionUIDInSerializableClassRule) IsFixable() bool
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 ¶
func (r *SerialVersionUIDInSerializableClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *ServiceCastRule) Meta() api.RuleDescriptor
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 ¶
func (r *ServiceExportedManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *SetJavaScriptEnabledRule) Meta() api.RuleDescriptor
type SetTextI18nRule ¶
type SetTextI18nRule struct {
FlatDispatchBase
AndroidRule
}
SetTextI18nRule detects setText() with hardcoded text.
func (*SetTextI18nRule) Meta ¶
func (r *SetTextI18nRule) Meta() api.RuleDescriptor
type SharedFlowWithoutReplayRule ¶
type SharedFlowWithoutReplayRule struct {
}
SharedFlowWithoutReplayRule detects MutableSharedFlow() with no buffer config.
func (*SharedFlowWithoutReplayRule) Confidence ¶
func (r *SharedFlowWithoutReplayRule) Confidence() float64
func (*SharedFlowWithoutReplayRule) Meta ¶
func (r *SharedFlowWithoutReplayRule) Meta() api.RuleDescriptor
type SharedMutableStateInObjectRule ¶
type SharedMutableStateInObjectRule struct {
}
func (*SharedMutableStateInObjectRule) Confidence ¶
func (r *SharedMutableStateInObjectRule) Confidence() float64
func (*SharedMutableStateInObjectRule) Meta ¶
func (r *SharedMutableStateInObjectRule) Meta() api.RuleDescriptor
type SharedPreferencesForSensitiveKeyRule ¶
type SharedPreferencesForSensitiveKeyRule struct {
}
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 (r *SharedPreferencesForSensitiveKeyRule) Confidence() float64
func (*SharedPreferencesForSensitiveKeyRule) Meta ¶
func (r *SharedPreferencesForSensitiveKeyRule) Meta() api.RuleDescriptor
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 ¶
func (r *SimpleDateFormatRule) Meta() api.RuleDescriptor
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 ¶
func (r *SingletonOnMutableClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *SleepInsteadOfDelayRule) Meta() api.RuleDescriptor
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 ¶
func (r *SmallSpResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *SpUsageResourceRule) Meta() api.RuleDescriptor
type SpacingAfterPackageAndImportsRule ¶
SpacingAfterPackageAndImportsRule checks for blank line after package/imports.
func (*SpacingAfterPackageAndImportsRule) Confidence ¶
func (r *SpacingAfterPackageAndImportsRule) Confidence() float64
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 ¶
func (r *SpacingAfterPackageAndImportsRule) Meta() api.RuleDescriptor
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 (r *SpanAttributeWithHighCardinalityRule) Confidence() float64
func (*SpanAttributeWithHighCardinalityRule) Meta ¶
func (r *SpanAttributeWithHighCardinalityRule) Meta() api.RuleDescriptor
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 ¶
func (r *SpanStartWithoutFinishRule) Meta() api.RuleDescriptor
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 ¶
func (r *SparseArrayRule) Meta() api.RuleDescriptor
type SpdxIdentifierInvalidRule ¶
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 ¶
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 ¶
func (r *SpdxIdentifierMismatchWithProjectRule) Confidence() float64
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 ¶
func (r *SpreadOperatorRule) Meta() api.RuleDescriptor
type SpyOnDataClassRule ¶
type SpyOnDataClassRule struct {
FlatDispatchBase
BaseRule
}
func (*SpyOnDataClassRule) Confidence ¶
func (r *SpyOnDataClassRule) Confidence() float64
func (*SpyOnDataClassRule) Meta ¶
func (r *SpyOnDataClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *SqliteCursorWithoutCloseRule) Meta() api.RuleDescriptor
type StartActivityWithUntrustedIntentRule ¶
type StartActivityWithUntrustedIntentRule struct {
FlatDispatchBase
AndroidRule
}
func (*StartActivityWithUntrustedIntentRule) Confidence ¶
func (r *StartActivityWithUntrustedIntentRule) Confidence() float64
func (*StartActivityWithUntrustedIntentRule) Meta ¶
func (r *StartActivityWithUntrustedIntentRule) Meta() api.RuleDescriptor
type StateFlowCompareByReferenceRule ¶
type StateFlowCompareByReferenceRule struct {
FlatDispatchBase
BaseRule
}
StateFlowCompareByReferenceRule detects .map{}.distinctUntilChanged() on StateFlow.
func (*StateFlowCompareByReferenceRule) Confidence ¶
func (r *StateFlowCompareByReferenceRule) Confidence() float64
func (*StateFlowCompareByReferenceRule) Meta ¶
func (r *StateFlowCompareByReferenceRule) Meta() api.RuleDescriptor
type StateFlowMutableLeakRule ¶
type StateFlowMutableLeakRule struct {
FlatDispatchBase
BaseRule
}
StateFlowMutableLeakRule detects publicly exposed MutableStateFlow.
func (*StateFlowMutableLeakRule) Confidence ¶
func (r *StateFlowMutableLeakRule) Confidence() float64
func (*StateFlowMutableLeakRule) Meta ¶
func (r *StateFlowMutableLeakRule) Meta() api.RuleDescriptor
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 ¶
func (r *StateListReachableResourceRule) Meta() api.RuleDescriptor
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 (`<`, `>`).
func (*StringContainsHTMLWithoutCDATARule) Confidence ¶
func (r *StringContainsHTMLWithoutCDATARule) Confidence() float64
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 ¶
func (r *StringFormatCountResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringFormatInvalidResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringFormatMatchesResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringFormatTrivialResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringIntegerRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringLiteralDuplicationRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringNotLocalizableResourceRule) Meta() api.RuleDescriptor
type StringNotSelectableRule ¶
type StringNotSelectableRule struct {
LayoutResourceBase
AndroidRule
}
func (*StringNotSelectableRule) Confidence ¶
func (r *StringNotSelectableRule) Confidence() float64
func (*StringNotSelectableRule) Meta ¶
func (r *StringNotSelectableRule) Meta() api.RuleDescriptor
type StringRepeatedInContentDescriptionRule ¶
type StringRepeatedInContentDescriptionRule struct {
LayoutResourceBase
AndroidRule
}
func (*StringRepeatedInContentDescriptionRule) Confidence ¶
func (r *StringRepeatedInContentDescriptionRule) Confidence() float64
func (*StringRepeatedInContentDescriptionRule) Meta ¶
func (r *StringRepeatedInContentDescriptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringResourceMissingPositionalRule) Confidence() float64
Confidence reports a tier-2 (medium) base confidence.
func (*StringResourceMissingPositionalRule) Meta ¶
func (r *StringResourceMissingPositionalRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringResourcePlaceholderOrderRule) Confidence() float64
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 ¶
func (r *StringShouldBeRawStringRule) Meta() api.RuleDescriptor
type StringSpanInContentDescriptionRule ¶
type StringSpanInContentDescriptionRule struct {
LayoutResourceBase
AndroidRule
}
func (*StringSpanInContentDescriptionRule) Confidence ¶
func (r *StringSpanInContentDescriptionRule) Confidence() float64
func (*StringSpanInContentDescriptionRule) Meta ¶
func (r *StringSpanInContentDescriptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *StringTrailingWhitespaceResourceRule) Confidence() float64
Confidence reports a tier-2 (medium) base confidence.
func (*StringTrailingWhitespaceResourceRule) Meta ¶
func (r *StringTrailingWhitespaceResourceRule) Meta() api.RuleDescriptor
type StructuredLogKeyMixedCaseRule ¶
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 ¶
func (r *StructuredLogKeyMixedCaseRule) Meta() api.RuleDescriptor
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 ¶
func (r *SubcomponentNotInstalledRule) Meta() api.RuleDescriptor
type SupervisorScopeInEventHandlerRule ¶
type SupervisorScopeInEventHandlerRule struct {
FlatDispatchBase
BaseRule
}
SupervisorScopeInEventHandlerRule detects supervisorScope with a single child operation.
func (*SupervisorScopeInEventHandlerRule) Confidence ¶
func (r *SupervisorScopeInEventHandlerRule) Confidence() float64
func (*SupervisorScopeInEventHandlerRule) Meta ¶
func (r *SupervisorScopeInEventHandlerRule) Meta() api.RuleDescriptor
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 ¶
func (r *SupportAnnotationUsageRule) Meta() api.RuleDescriptor
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 ¶
func (r *SuppressedWarningWithoutJustificationRule) Confidence() float64
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 ¶
func (r *SuspendFunInFinallySectionRule) Meta() api.RuleDescriptor
type SuspendFunSwallowedCancellationRule ¶
type SuspendFunSwallowedCancellationRule struct {
FlatDispatchBase
BaseRule
}
SuspendFunSwallowedCancellationRule detects catching CancellationException without rethrow.
func (*SuspendFunSwallowedCancellationRule) Confidence ¶
func (r *SuspendFunSwallowedCancellationRule) Confidence() float64
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 (r *SuspendFunSwallowedCancellationRule) IsFixable() bool
func (*SuspendFunSwallowedCancellationRule) Meta ¶
func (r *SuspendFunSwallowedCancellationRule) Meta() api.RuleDescriptor
type SuspendFunWithCoroutineScopeReceiverRule ¶
type SuspendFunWithCoroutineScopeReceiverRule struct {
FlatDispatchBase
BaseRule
}
SuspendFunWithCoroutineScopeReceiverRule detects suspend fun CoroutineScope.x().
func (*SuspendFunWithCoroutineScopeReceiverRule) Confidence ¶
func (r *SuspendFunWithCoroutineScopeReceiverRule) 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 (*SuspendFunWithCoroutineScopeReceiverRule) IsFixable ¶
func (r *SuspendFunWithCoroutineScopeReceiverRule) IsFixable() bool
func (*SuspendFunWithCoroutineScopeReceiverRule) Meta ¶
func (r *SuspendFunWithCoroutineScopeReceiverRule) Meta() api.RuleDescriptor
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 ¶
func (r *Suspicious0dpResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *SwallowedExceptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *SwitchIntDefRule) Meta() api.RuleDescriptor
type SynchronizedOnBoxedPrimitiveRule ¶
type SynchronizedOnBoxedPrimitiveRule struct {
FlatDispatchBase
BaseRule
}
SynchronizedOnBoxedPrimitiveRule detects synchronized() on boxed primitives.
func (*SynchronizedOnBoxedPrimitiveRule) Confidence ¶
func (r *SynchronizedOnBoxedPrimitiveRule) Confidence() float64
func (*SynchronizedOnBoxedPrimitiveRule) Meta ¶
func (r *SynchronizedOnBoxedPrimitiveRule) Meta() api.RuleDescriptor
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 ¶
func (r *SynchronizedOnNonFinalRule) Meta() api.RuleDescriptor
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 ¶
func (r *SynchronizedOnStringRule) Meta() api.RuleDescriptor
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 ¶
func (r *SystemPermissionRule) Meta() api.RuleDescriptor
type TargetNewerRule ¶
type TargetNewerRule struct {
ManifestBase
AndroidRule
}
TargetNewerRule checks that targetSdkVersion is reasonably recent (>= 33).
func (*TargetNewerRule) Meta ¶
func (r *TargetNewerRule) Meta() api.RuleDescriptor
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 ¶
func (r *TempFileWorldReadableRule) Meta() api.RuleDescriptor
type TestDispatcherNotInjectedRule ¶
type TestDispatcherNotInjectedRule struct {
FlatDispatchBase
BaseRule
}
func (*TestDispatcherNotInjectedRule) Confidence ¶
func (r *TestDispatcherNotInjectedRule) Confidence() float64
func (*TestDispatcherNotInjectedRule) Meta ¶
func (r *TestDispatcherNotInjectedRule) Meta() api.RuleDescriptor
type TestFixtureAccessedFromProductionRule ¶
type TestFixtureAccessedFromProductionRule struct {
BaseRule
}
TestFixtureAccessedFromProductionRule flags usage of types declared under src/testFixtures/ from non-test files.
func (*TestFixtureAccessedFromProductionRule) Confidence ¶
func (r *TestFixtureAccessedFromProductionRule) Confidence() float64
func (*TestFixtureAccessedFromProductionRule) Meta ¶
func (r *TestFixtureAccessedFromProductionRule) Meta() api.RuleDescriptor
type TestFunctionReturnValueRule ¶
type TestFunctionReturnValueRule struct {
FlatDispatchBase
BaseRule
}
func (*TestFunctionReturnValueRule) Confidence ¶
func (r *TestFunctionReturnValueRule) Confidence() float64
func (*TestFunctionReturnValueRule) Meta ¶
func (r *TestFunctionReturnValueRule) Meta() api.RuleDescriptor
type TestInheritanceDepthRule ¶
type TestInheritanceDepthRule struct {
FlatDispatchBase
BaseRule
}
func (*TestInheritanceDepthRule) Confidence ¶
func (r *TestInheritanceDepthRule) Confidence() float64
func (*TestInheritanceDepthRule) Meta ¶
func (r *TestInheritanceDepthRule) Meta() api.RuleDescriptor
type TestNameContainsUnderscoreRule ¶
type TestNameContainsUnderscoreRule struct {
FlatDispatchBase
BaseRule
}
func (*TestNameContainsUnderscoreRule) Confidence ¶
func (r *TestNameContainsUnderscoreRule) Confidence() float64
func (*TestNameContainsUnderscoreRule) Meta ¶
func (r *TestNameContainsUnderscoreRule) Meta() api.RuleDescriptor
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 ¶
func (r *TestOnlyImportInProductionRule) Meta() api.RuleDescriptor
type TestWithOnlyTodoRule ¶
type TestWithOnlyTodoRule struct {
FlatDispatchBase
BaseRule
}
func (*TestWithOnlyTodoRule) Confidence ¶
func (r *TestWithOnlyTodoRule) Confidence() float64
func (*TestWithOnlyTodoRule) Meta ¶
func (r *TestWithOnlyTodoRule) Meta() api.RuleDescriptor
type TestWithoutAssertionRule ¶
type TestWithoutAssertionRule struct {
FlatDispatchBase
BaseRule
AllowNoAssertionTests bool
AssertionMethodPatterns []string
}
func (*TestWithoutAssertionRule) Confidence ¶
func (r *TestWithoutAssertionRule) Confidence() float64
func (*TestWithoutAssertionRule) Meta ¶
func (r *TestWithoutAssertionRule) Meta() api.RuleDescriptor
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 ¶
func (r *TextFieldsResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *TextViewEditsRule) Meta() api.RuleDescriptor
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 ¶
func (r *ThrowingExceptionFromFinallyRule) Meta() api.RuleDescriptor
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 ¶
func (r *ThrowingExceptionInMainRule) Meta() api.RuleDescriptor
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 ¶
func (r *ThrowingExceptionsWithoutMessageOrCauseRule) 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 (*ThrowingExceptionsWithoutMessageOrCauseRule) Meta ¶
func (r *ThrowingExceptionsWithoutMessageOrCauseRule) Meta() api.RuleDescriptor
type ThrowingNewInstanceOfSameExceptionRule ¶
type ThrowingNewInstanceOfSameExceptionRule struct {
FlatDispatchBase
BaseRule
}
ThrowingNewInstanceOfSameExceptionRule detects catch(e: X) { throw X(e) }.
func (*ThrowingNewInstanceOfSameExceptionRule) Confidence ¶
func (r *ThrowingNewInstanceOfSameExceptionRule) 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 (*ThrowingNewInstanceOfSameExceptionRule) Meta ¶
func (r *ThrowingNewInstanceOfSameExceptionRule) Meta() api.RuleDescriptor
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 ¶
func (r *ThrowsCountRule) Meta() api.RuleDescriptor
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 ¶
func (r *TimberTreeNotPlantedRule) Meta() api.RuleDescriptor
type ToastForAccessibilityAnnouncementRule ¶
type ToastForAccessibilityAnnouncementRule struct {
FlatDispatchBase
BaseRule
}
func (*ToastForAccessibilityAnnouncementRule) Confidence ¶
func (r *ToastForAccessibilityAnnouncementRule) Confidence() float64
func (*ToastForAccessibilityAnnouncementRule) Meta ¶
func (r *ToastForAccessibilityAnnouncementRule) Meta() api.RuleDescriptor
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 ¶
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 ¶
func (r *TooDeepLayoutResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *TooGenericExceptionCaughtRule) Meta() api.RuleDescriptor
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 ¶
func (r *TooGenericExceptionThrownRule) Meta() api.RuleDescriptor
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 ¶
func (r *TooManyFunctionsRule) Meta() api.RuleDescriptor
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 ¶
func (r *TooManyViewsResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *TopLevelPropertyNamingRule) Meta() api.RuleDescriptor
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 ¶
func (r *TraceIDLoggedAsPlainMessageRule) Meta() api.RuleDescriptor
type TrailingWhitespaceRule ¶
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 ¶
func (r *TrailingWhitespaceRule) Meta() api.RuleDescriptor
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 ¶
func (r *TrimMultilineRawStringRule) Meta() api.RuleDescriptor
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 ¶
func (r *TrulyRandomRule) Meta() api.RuleDescriptor
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 ¶
func (r *TrustedServerRule) Meta() api.RuleDescriptor
type UnconditionalJumpStatementInLoopRule ¶
type UnconditionalJumpStatementInLoopRule struct {
FlatDispatchBase
BaseRule
}
--------------------------------------------------------------------------- UnconditionalJumpStatementInLoopRule detects loop with unconditional return/break. ---------------------------------------------------------------------------
func (*UnconditionalJumpStatementInLoopRule) Confidence ¶
func (r *UnconditionalJumpStatementInLoopRule) 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 (*UnconditionalJumpStatementInLoopRule) Meta ¶
func (r *UnconditionalJumpStatementInLoopRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnderscoresInNumericLiteralsRule) Meta() api.RuleDescriptor
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 ¶
func (r *UndocumentedPublicClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *UndocumentedPublicFunctionRule) Meta() api.RuleDescriptor
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 ¶
func (r *UndocumentedPublicPropertyRule) Meta() api.RuleDescriptor
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 ¶
func (r *UniqueConstantsRule) Meta() api.RuleDescriptor
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 ¶
func (r *UniquePermissionRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnknownIDInLayoutRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnamedParameterUseRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryAnyRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryApplyRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryBackticksRule) Meta() api.RuleDescriptor
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 (r *UnnecessaryBracesAroundTrailingLambdaRule) IsFixable() bool
func (*UnnecessaryBracesAroundTrailingLambdaRule) Meta ¶
func (r *UnnecessaryBracesAroundTrailingLambdaRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryFilterRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryFullyQualifiedNameRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryInheritanceRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryInitOnArrayRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryInnerClassRule) Meta() api.RuleDescriptor
type UnnecessaryLetRule ¶
type UnnecessaryLetRule struct {
FlatDispatchBase
BaseRule
}
UnnecessaryLetRule detects unnecessary .let {} calls via AST dispatch. Flags two patterns:
- Identity let: `x?.let { it }` \u2014 the value can be used directly.
- 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 ¶
func (r *UnnecessaryLetRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryNotNullCheckRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryNotNullOperatorRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryParenthesesRule) Meta() api.RuleDescriptor
type UnnecessaryPartOfBinaryExpressionRule ¶
type UnnecessaryPartOfBinaryExpressionRule struct {
FlatDispatchBase
BaseRule
}
UnnecessaryPartOfBinaryExpressionRule detects x && true, x || false, etc.
func (*UnnecessaryPartOfBinaryExpressionRule) Confidence ¶
func (r *UnnecessaryPartOfBinaryExpressionRule) 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 (*UnnecessaryPartOfBinaryExpressionRule) IsFixable ¶
func (r *UnnecessaryPartOfBinaryExpressionRule) IsFixable() bool
Performance rules
func (*UnnecessaryPartOfBinaryExpressionRule) Meta ¶
func (r *UnnecessaryPartOfBinaryExpressionRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryReversedRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessarySafeCallRule) Meta() api.RuleDescriptor
type UnnecessaryTemporaryInstantiationRule ¶
type UnnecessaryTemporaryInstantiationRule struct {
FlatDispatchBase
BaseRule
}
UnnecessaryTemporaryInstantiationRule detects Integer.valueOf(x).toString() etc.
func (*UnnecessaryTemporaryInstantiationRule) Confidence ¶
func (r *UnnecessaryTemporaryInstantiationRule) 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 (*UnnecessaryTemporaryInstantiationRule) IsFixable ¶
func (r *UnnecessaryTemporaryInstantiationRule) IsFixable() bool
func (*UnnecessaryTemporaryInstantiationRule) Meta ¶
func (r *UnnecessaryTemporaryInstantiationRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnnecessaryTypeCastingRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnpackedNativeCodeManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnprotectedDynamicReceiverRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnprotectedSMSBroadcastReceiverManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnreachableCatchBlockRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnreachableCodeRule) Meta() api.RuleDescriptor
type UnsafeCallOnNullableTypeRule ¶
type UnsafeCallOnNullableTypeRule struct {
FlatDispatchBase
BaseRule
CustomPreviewWildcard bool
CustomPreviewPrefixes []string
}
--------------------------------------------------------------------------- UnsafeCallOnNullableTypeRule detects !! operator usage. ---------------------------------------------------------------------------
func (*UnsafeCallOnNullableTypeRule) Meta ¶
func (r *UnsafeCallOnNullableTypeRule) Meta() api.RuleDescriptor
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) 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 ¶
func (r *UnsafeProtectedBroadcastReceiverManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnstructuredErrorLogRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnsupportedChromeOsHardwareManifestRule) Meta() api.RuleDescriptor
type UntestedPublicAPIRule ¶
type UntestedPublicAPIRule struct {
BaseRule
}
func (*UntestedPublicAPIRule) Confidence ¶
func (r *UntestedPublicAPIRule) Confidence() float64
func (*UntestedPublicAPIRule) Meta ¶
func (r *UntestedPublicAPIRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedAttributeResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedImportRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedNamespaceResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedParameterRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedPrivateClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedPrivateFunctionRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedPrivateMemberRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedPrivatePropertyRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedQuantityResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedResourcesRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedUnaryOperatorRule) Meta() api.RuleDescriptor
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 ¶
func (r *UnusedVariableRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseAnyOrNoneInsteadOfFindRule) Meta() api.RuleDescriptor
type UseArrayLiteralsInAnnotationsRule ¶
type UseArrayLiteralsInAnnotationsRule struct {
FlatDispatchBase
BaseRule
}
func (*UseArrayLiteralsInAnnotationsRule) Confidence ¶
func (r *UseArrayLiteralsInAnnotationsRule) 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 (*UseArrayLiteralsInAnnotationsRule) IsFixable ¶
func (r *UseArrayLiteralsInAnnotationsRule) IsFixable() bool
func (*UseArrayLiteralsInAnnotationsRule) Meta ¶
func (r *UseArrayLiteralsInAnnotationsRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseCheckNotNullRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseCheckOrErrorRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseCheckPermissionManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseCompoundDrawablesResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseDataClassRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseEmptyCounterpartRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseIfEmptyOrIfBlankRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseIfInsteadOfWhenRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseIsNullOrEmptyRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseRequireNotNullRule) Meta() api.RuleDescriptor
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 ¶
func (r *UseSumOfInsteadOfFlatMapSizeRule) Meta() api.RuleDescriptor
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 ¶
func (r *UselessCallOnNotNullRule) Meta() api.RuleDescriptor
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 ¶
func (r *UselessLeafResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *UselessParentResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *UselessPostfixExpressionRule) Meta() api.RuleDescriptor
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 ¶
func (r *UsesSdkManifestRule) Meta() api.RuleDescriptor
type UtilityClassWithPublicConstructorRule ¶
type UtilityClassWithPublicConstructorRule struct {
FlatDispatchBase
BaseRule
}
UtilityClassWithPublicConstructorRule detects utility classes with public constructors.
func (*UtilityClassWithPublicConstructorRule) Confidence ¶
func (r *UtilityClassWithPublicConstructorRule) 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 (*UtilityClassWithPublicConstructorRule) IsFixable ¶
func (r *UtilityClassWithPublicConstructorRule) IsFixable() bool
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 ¶
func (r *UtilityClassWithPublicConstructorRule) Meta() api.RuleDescriptor
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 ¶
func (r *VarCouldBeValRule) Meta() api.RuleDescriptor
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 ¶
func (r *VariableMaxLengthRule) Meta() api.RuleDescriptor
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 ¶
func (r *VariableMinLengthRule) Meta() api.RuleDescriptor
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 ¶
func (r *VariableNamingRule) Meta() api.RuleDescriptor
type VerifyWithoutMockRule ¶
type VerifyWithoutMockRule struct {
FlatDispatchBase
BaseRule
}
func (*VerifyWithoutMockRule) Confidence ¶
func (r *VerifyWithoutMockRule) Confidence() float64
func (*VerifyWithoutMockRule) Meta ¶
func (r *VerifyWithoutMockRule) Meta() api.RuleDescriptor
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 (r *VersionCatalogBuildSrcMismatchRule) Confidence() float64
func (*VersionCatalogBuildSrcMismatchRule) Meta ¶
func (r *VersionCatalogBuildSrcMismatchRule) Meta() api.RuleDescriptor
func (*VersionCatalogBuildSrcMismatchRule) ModuleAwareNeeds ¶
func (r *VersionCatalogBuildSrcMismatchRule) ModuleAwareNeeds() 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 ¶
func (r *VersionCatalogDuplicateVersionRule) Confidence() float64
Confidence is high — duplicate literal version strings are a straightforward textual fact derived from the parsed catalog.
func (*VersionCatalogDuplicateVersionRule) Meta ¶
func (r *VersionCatalogDuplicateVersionRule) Meta() api.RuleDescriptor
func (*VersionCatalogDuplicateVersionRule) ModuleAwareNeeds ¶
func (r *VersionCatalogDuplicateVersionRule) ModuleAwareNeeds() 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 (r *VersionCatalogRawVersionInBuildRule) Confidence() float64
func (*VersionCatalogRawVersionInBuildRule) Meta ¶
func (r *VersionCatalogRawVersionInBuildRule) Meta() api.RuleDescriptor
func (*VersionCatalogRawVersionInBuildRule) ModuleAwareNeeds ¶
func (r *VersionCatalogRawVersionInBuildRule) ModuleAwareNeeds() 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 (r *VersionCatalogUnusedRule) Meta() api.RuleDescriptor
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 ¶
func (r *ViewConstructorRule) Meta() api.RuleDescriptor
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 (r *VisibleForTestingCallerInNonTestRule) Confidence() float64
func (*VisibleForTestingCallerInNonTestRule) Meta ¶
func (r *VisibleForTestingCallerInNonTestRule) Meta() api.RuleDescriptor
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 ¶
func (r *VolatileMissingOnDclRule) Meta() api.RuleDescriptor
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 ¶
func (r *WeakKeySizeRule) Meta() api.RuleDescriptor
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 ¶
func (r *WeakMacAlgorithmRule) Meta() api.RuleDescriptor
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 ¶
func (r *WeakMessageDigestRule) Meta() api.RuleDescriptor
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 ¶
func (r *WebViewAllowContentAccessRule) Meta() api.RuleDescriptor
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 ¶
func (r *WebViewAllowFileAccessRule) Meta() api.RuleDescriptor
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 ¶
func (r *WebViewDebuggingEnabledRule) Meta() api.RuleDescriptor
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 (r *WebViewFileAccessFromFileUrlsRule) Confidence() float64
func (*WebViewFileAccessFromFileUrlsRule) Meta ¶
func (r *WebViewFileAccessFromFileUrlsRule) Meta() api.RuleDescriptor
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 ¶
func (r *WebViewInScrollViewResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *WebViewMixedContentAllowAllRule) Meta() api.RuleDescriptor
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 (r *WebViewUniversalAccessFromFileUrlsRule) Confidence() float64
func (*WebViewUniversalAccessFromFileUrlsRule) Meta ¶
func (r *WebViewUniversalAccessFromFileUrlsRule) Meta() api.RuleDescriptor
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 ¶
func (r *WildcardImportRule) Meta() api.RuleDescriptor
type WithContextInSuspendFunctionNoopRule ¶
type WithContextInSuspendFunctionNoopRule struct {
FlatDispatchBase
BaseRule
}
WithContextInSuspendFunctionNoopRule detects nested withContext with the same dispatcher.
func (*WithContextInSuspendFunctionNoopRule) Confidence ¶
func (r *WithContextInSuspendFunctionNoopRule) Confidence() float64
func (*WithContextInSuspendFunctionNoopRule) Meta ¶
func (r *WithContextInSuspendFunctionNoopRule) Meta() api.RuleDescriptor
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 (r *WithContextWithoutTracingContextRule) Confidence() float64
func (*WithContextWithoutTracingContextRule) Meta ¶
func (r *WithContextWithoutTracingContextRule) Meta() api.RuleDescriptor
type WorkManagerNoBackoffRule ¶
type WorkManagerNoBackoffRule struct {
FlatDispatchBase
BaseRule
}
WorkManagerNoBackoffRule detects OneTimeWorkRequestBuilder chains without setBackoffCriteria.
func (*WorkManagerNoBackoffRule) Confidence ¶
func (r *WorkManagerNoBackoffRule) Confidence() float64
func (*WorkManagerNoBackoffRule) Meta ¶
func (r *WorkManagerNoBackoffRule) Meta() api.RuleDescriptor
type WorkManagerUniquePolicyKeepButReplaceIntendedRule ¶
type WorkManagerUniquePolicyKeepButReplaceIntendedRule struct {
FlatDispatchBase
BaseRule
}
WorkManagerUniquePolicyKeepButReplaceIntendedRule detects enqueueUniqueWork with ExistingWorkPolicy.KEEP where REPLACE may be intended.
func (*WorkManagerUniquePolicyKeepButReplaceIntendedRule) Confidence ¶
func (r *WorkManagerUniquePolicyKeepButReplaceIntendedRule) Confidence() float64
func (*WorkManagerUniquePolicyKeepButReplaceIntendedRule) Meta ¶
func (r *WorkManagerUniquePolicyKeepButReplaceIntendedRule) Meta() api.RuleDescriptor
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 ¶
func (r *WorldReadableFilesRule) Meta() api.RuleDescriptor
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 ¶
func (r *WorldWriteableFilesRule) Meta() api.RuleDescriptor
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 ¶
func (r *WrongCaseResourceRule) Meta() api.RuleDescriptor
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 (r *WrongConstantRule) Meta() api.RuleDescriptor
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 ¶
func (r *WrongEqualsTypeParameterRule) Meta() api.RuleDescriptor
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 ¶
func (r *WrongFolderResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *WrongImportRule) Meta() api.RuleDescriptor
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 ¶
func (r *WrongManifestParentManifestRule) Meta() api.RuleDescriptor
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 ¶
func (r *WrongRegionResourceRule) Meta() api.RuleDescriptor
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 ¶
func (r *WrongThreadRule) Meta() api.RuleDescriptor
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 (r *WrongViewCastRule) Meta() api.RuleDescriptor
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 ¶
func (r *XMLExternalEntityRule) Meta() api.RuleDescriptor
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 ¶
func (r *ZipSlipUncheckedRule) Meta() api.RuleDescriptor
Source Files
¶
- accessibility.go
- aliases.go
- android.go
- android_correctness.go
- android_correctness_checks.go
- android_deps.go
- android_gradle.go
- android_i18n.go
- android_icons.go
- android_manifest.go
- android_manifest_features.go
- android_manifest_gradle.go
- android_manifest_i18n.go
- android_manifest_security.go
- android_manifest_structure.go
- android_onclick.go
- android_performance.go
- android_resource.go
- android_resource_a11y.go
- android_resource_ids.go
- android_resource_layout.go
- android_resource_rtl.go
- android_resource_style.go
- android_resource_values.go
- android_security.go
- android_security_misc.go
- android_security_secure_random.go
- android_source.go
- android_source_extra.go
- android_usability.go
- android_web_settings.go
- android_webview_allow_content_access.go
- android_webview_allow_file_access.go
- android_webview_debugging_enabled.go
- android_webview_file_access_from_file_urls.go
- android_webview_mixed_content_allow_all.go
- android_webview_universal_access_from_file_urls.go
- annotations.go
- comments.go
- complexity.go
- compose.go
- confidence.go
- config.go
- config_adapter.go
- coroutines.go
- correctness_abstract.go
- correctness_override.go
- custom_pattern.go
- custom_preview.go
- database.go
- deadcode.go
- deadcode_module.go
- declaration_summary.go
- defaults.go
- di_hygiene.go
- dispatch.go
- dispatcher.go
- editor_finalize.go
- emptyblocks.go
- exceptions.go
- filefacts.go
- fix_byte_edits.go
- fixes.go
- fixlevel.go
- flat_annotation.go
- flat_call.go
- flat_class.go
- flat_navigation.go
- flat_node.go
- flat_string.go
- framework_entrypoints.go
- hotspot.go
- i18n_locale_default_for_formatting.go
- i18n_markup.go
- i18n_plurals.go
- i18n_string_concat.go
- i18n_string_contains_html_without_cdata.go
- i18n_string_resource_placeholder_order.go
- i18n_string_template.go
- i18n_text_direction.go
- i18n_unicode_normalization.go
- i18n_upperlower.go
- java_support.go
- kdoc_link_validation.go
- layer_dependency_violation.go
- library.go
- licensing.go
- lifecycle.go
- meta_accessibility.go
- meta_android_correctness.go
- meta_android_correctness_checks.go
- meta_android_gradle.go
- meta_android_icons.go
- meta_android_manifest_features.go
- meta_android_manifest_i18n.go
- meta_android_manifest_security.go
- meta_android_manifest_structure.go
- meta_android_resource_a11y.go
- meta_android_resource_ids.go
- meta_android_resource_layout.go
- meta_android_resource_rtl.go
- meta_android_resource_style.go
- meta_android_resource_values.go
- meta_android_rules.go
- meta_android_security.go
- meta_android_source.go
- meta_android_source_extra.go
- meta_android_usability.go
- meta_comments.go
- meta_complexity.go
- meta_compose.go
- meta_coroutines.go
- meta_database.go
- meta_deadcode.go
- meta_di_hygiene.go
- meta_emptyblocks.go
- meta_exceptions.go
- meta_forbidden_import.go
- meta_hotspot.go
- meta_index.go
- meta_layer_dependency_violation.go
- meta_library.go
- meta_lookup.go
- meta_naming.go
- meta_newer_version_available.go
- meta_observability.go
- meta_package_dependency_cycle.go
- meta_package_naming_convention_drift.go
- meta_performance.go
- meta_potentialbugs_exceptions.go
- meta_potentialbugs_lifecycle.go
- meta_potentialbugs_misc.go
- meta_potentialbugs_nullsafety_bangbang.go
- meta_potentialbugs_nullsafety_casts.go
- meta_potentialbugs_nullsafety_redundant.go
- meta_potentialbugs_properties.go
- meta_potentialbugs_types.go
- meta_privacy_analytics.go
- meta_privacy_permissions.go
- meta_privacy_storage.go
- meta_public_to_internal_leaky_abstraction.go
- meta_release_engineering.go
- meta_resource_cost.go
- meta_security.go
- meta_style_braces.go
- meta_style_classes.go
- meta_style_expressions.go
- meta_style_expressions_extra.go
- meta_style_forbidden.go
- meta_style_format.go
- meta_style_idiomatic.go
- meta_style_idiomatic_data.go
- meta_style_redundant.go
- meta_style_unnecessary.go
- meta_style_unused.go
- meta_supply_chain.go
- meta_testing_quality.go
- module_dependency_cycle.go
- module_template_conformance.go
- naming.go
- observability.go
- observability_helpers.go
- oracle_call_target_derivation.go
- oracle_filter_bridge.go
- oracle_flat_helpers.go
- package_dependency_cycle.go
- package_naming_convention_drift.go
- performance.go
- potentialbugs_exceptions.go
- potentialbugs_lifecycle.go
- potentialbugs_misc.go
- potentialbugs_nullsafety_bangbang.go
- potentialbugs_nullsafety_casts.go
- potentialbugs_nullsafety_redundant.go
- potentialbugs_properties.go
- potentialbugs_smartcast.go
- potentialbugs_types.go
- precision.go
- privacy_analytics.go
- privacy_permissions.go
- privacy_storage.go
- public_to_internal_leaky_abstraction.go
- registry_accessibility.go
- registry_android_correctness.go
- registry_android_correctness_checks.go
- registry_android_gradle.go
- registry_android_icons.go
- registry_android_manifest_features.go
- registry_android_manifest_i18n.go
- registry_android_manifest_security.go
- registry_android_manifest_structure.go
- registry_android_resource_a11y.go
- registry_android_resource_ids.go
- registry_android_resource_layout.go
- registry_android_resource_rtl.go
- registry_android_resource_style.go
- registry_android_resource_values.go
- registry_android_rules.go
- registry_android_security.go
- registry_android_source.go
- registry_android_source_extra.go
- registry_android_usability.go
- registry_bootstrap.go
- registry_comments.go
- registry_complexity.go
- registry_compose.go
- registry_coroutines.go
- registry_correctness_abstract.go
- registry_correctness_override.go
- registry_database.go
- registry_deadcode.go
- registry_deadcode_module.go
- registry_di_hygiene.go
- registry_emptyblocks.go
- registry_exceptions.go
- registry_hotspot.go
- registry_i18n_locale_default_for_formatting.go
- registry_i18n_markup.go
- registry_i18n_plurals.go
- registry_i18n_string_concat.go
- registry_i18n_string_contains_html_without_cdata.go
- registry_i18n_string_template.go
- registry_i18n_text_direction.go
- registry_i18n_unicode_normalization.go
- registry_i18n_upperlower.go
- registry_layer_dependency_violation.go
- registry_library.go
- registry_licensing.go
- registry_module_dependency_cycle.go
- registry_naming.go
- registry_observability.go
- registry_package_dependency_cycle.go
- registry_package_naming_convention_drift.go
- registry_performance.go
- registry_potentialbugs_exceptions.go
- registry_potentialbugs_lifecycle.go
- registry_potentialbugs_misc.go
- registry_potentialbugs_nullsafety_bangbang.go
- registry_potentialbugs_nullsafety_casts.go
- registry_potentialbugs_nullsafety_redundant.go
- registry_potentialbugs_properties.go
- registry_potentialbugs_smartcast.go
- registry_potentialbugs_types.go
- registry_privacy_analytics.go
- registry_privacy_permissions.go
- registry_privacy_storage.go
- registry_public_to_internal_leaky_abstraction.go
- registry_release_engineering.go
- registry_resource_cost.go
- registry_security.go
- registry_style_braces.go
- registry_style_classes.go
- registry_style_expressions.go
- registry_style_expressions_extra.go
- registry_style_forbidden.go
- registry_style_format.go
- registry_style_idiomatic.go
- registry_style_idiomatic_data.go
- registry_style_redundant.go
- registry_style_unnecessary.go
- registry_style_unused.go
- registry_supply_chain.go
- registry_testing_quality.go
- release_engineering.go
- release_engineering_helpers.go
- reporter.go
- resource_cost.go
- rule.go
- runafter.go
- sample_annotation_freshness.go
- secrets_helpers.go
- security.go
- security_hardcoded_aws_access_key.go
- security_hardcoded_jwt.go
- semantic_rule_helpers.go
- style_braces.go
- style_classes.go
- style_expressions.go
- style_expressions_extra.go
- style_forbidden.go
- style_format.go
- style_idiomatic.go
- style_idiomatic_data.go
- style_redundant.go
- style_unnecessary.go
- style_unused.go
- supply_catalog.go
- supply_catalog_buildsrc_mismatch.go
- supply_catalog_duplicate_version.go
- supply_catalog_raw_version_in_build.go
- supply_chain.go
- supply_ci_workflows.go
- supply_dependencies.go
- supply_drift.go
- supply_verification.go
- testing_quality.go
- typeparam.go
Directories
¶
| Path | Synopsis |
|---|---|
|
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. |