Skip to content

[TECHNICAL] Detekt: static code analyzer #4506

Closed

Description

@jesmrec

Adding a new static code analyzer for Kotlin: https://detekt.dev/

TASKS

  • Research (if needed)
  • Create branch feature/detekt
  • Initial set up of the tool
  • First try to integrate in CI (github actions)
  • Launch the analyzer to get an initial set of existing code smells
  • Analyze the code smells and decide what to do with them
  • Check if more rules should be added or removed from the set of existing rules
  • Fix all code smells:
    • MaxLineLength: max 150 characters per line -> CR ✅
    • LongMethod: refactor all methods with more than 100 lines -> CR ✅
    • UnusedPrivateMember -> CR ✅
    • UnusedPrivateProperty -> CR ✅
    • UseIfInsteadOfWhen -> CR ✅
    • UseLet -> CR ✅
    • SpacingBetweenPackageAndImports -> CR ✅
    • ExplicitItLambdaParameter (data module) -> CR ✅
    • CollapsibleIfStatements -> CR ✅
    • UnusedParameter -> CR ✅
    • InvalidPackageDeclaration -> CR ✅
    • ExpressionBodySyntax -> CR ✅
    • NewLineAtEndOfFile -> CR ✅
    • MemberNameEqualsClassName -> CR ✅
    • ForbiddenComment -> CR ✅
    • WildCardImport -> CR ✅
    • VariableNaming -> CR ✅
    • EmptySecondaryConstructor -> CR ✅
    • NotImplementedDeclaration -> CR ✅
    • MandatoryBracesLoops -> CR ✅
    • ClassOrdering -> CR ✅
    • MatchingDeclarationName -> CR ✅
    • ImplicitDefaultLocale -> CR ✅
    • SpreadOperator (in migrations, add ALLMIGRATIONS to array directly) -> CR ✅
    • UtilityClassWithPublicConstructor -> CR ✅
    • OptionalUnit -> CR ✅
    • BracesOnIfStatements -> CR ✅
    • BracesOnWhenStatements -> CR ✅
    • AlsoCouldBeApply -> CR ✅
    • SwallowedException -> CR ✅
    • PrintStackTrace -> CR ✅
    • InstanceOfCheckForException -> CR ✅
    • ConstructorParameterNaming -> CR ✅
    • ThrowingExceptionsWithoutMessageOrCause -> CR ✅
    • ComplexCondition -> CR ✅
  • Final CI setup (correct branching and setup ready to go)
  • No code smells -> green CI
  • Add Calens file
  • Code review and apply changes requested
  • Merge branch feature/detekt into master

Activity

  1. linked a pull request that will close this issue[TECHNICAL] Detekt: static code analyzer #4487on Oct 30, 2024
  2. jesmrec commented on Oct 30, 2024

    @jesmrec
    MemberAuthor

    Some dependency on #4478.

    Gradle version to push on, will determine the basic detekt version to use

  3. changed the title [-]Detekt: static code analyzer[/-] [+][TECHINICAL] Detekt: static code analyzer[/+] on Oct 30, 2024
  4. changed the title [-][TECHINICAL] Detekt: static code analyzer[/-] [+][TECHNICAL] Detekt: static code analyzer[/+] on Oct 30, 2024
  5. jesmrec commented on Dec 4, 2024

    @jesmrec
    MemberAuthor

    Some rules did not return code smells, but they were candidates. They might deserve a look:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions