• d

    dead.fish

    2 years ago
    Could any of the regular devs have a look at https://github.com/detekt/detekt/pull/2787 and tell me if I’m on the right track or if I am horribly wrong off road? Thanks 😄
    d
    gammax
    +1
    4 replies
    Copy to Clipboard
  • Venkat , Bangalore , India

    Venkat , Bangalore , India

    2 years ago
    Hi All, I am facing strange issue with SpreadOperator as Sonar blocked it https://arturbosch.github.io/detekt/performance.html#spreadoperator . We have gone through this link but we could not understand how to fix this issue if the array is dynamic ( coming from an external library).. Can any one please help me on how to fix this issue.?
    Venkat , Bangalore , India
    Charles
    +1
    4 replies
    Copy to Clipboard
  • sanogueralorenzo

    sanogueralorenzo

    2 years ago
    Hello everyone, does anyone have the detektAll tasks but in groovy? 😄 https://github.com/sanogueralorenzo/Android-Kotlin-Clean-Architecture/blob/master/build.gradle.kts#L35 I see myself converting to kts everytime just to add the task 😄
    sanogueralorenzo
    gammax
    2 replies
    Copy to Clipboard
  • pedro

    pedro

    2 years ago
    I’m having problems using detekt in my project… (kotlin jvm project) I have different problems if I use 1.9.1 or 1.10.0 1.10.0
    Execution failed for task ':foo:detekt'.
    > Could not resolve all files for configuration ':foo:detekt'.
       > Could not find io.gitlab.arturbosch.detekt:detekt-cli:1.10.0.
         Searched in the following locations:
           - <https://repo.maven.apache.org/maven2/io/gitlab/arturbosch/detekt/detekt-cli/1.10.0/detekt-cli-1.10.0.pom>
         If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
    I have seen someone mentioning in github issues that it seems that some artifacts weren’t published in all repositories If I try to use 1.9.1:
    > Could not find org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.1.
         Searched in the following locations:
           - <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-html-jvm/0.7.1/kotlinx-html-jvm-0.7.1.pom>
         If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
         Required by:
             project :foo > io.gitlab.arturbosch.detekt:detekt-cli:1.9.1
    I’ve tried all possible combinations of the instructions in the website and still haven’t got it to work. Can someone help?
    pedro
    gammax
    +1
    19 replies
    Copy to Clipboard
  • b

    bbaldino

    2 years ago
    I can't seem to get the
    ForbiddenMethodCall
    to work, I've got it configured like so:
    style:
      active: true
      ForbiddenMethodCall:
        active: true
        methods: ['java.util.concurrent.ExecutorService.submit', 'kotlin.io.println']
    in a custom
    detekt.yml
    (which doesn't contain much else). I'm using the maven plugin and have it pointing to that config file. (I added
    println
    in there to try and test after the first one wasn't working.) It's not triggering for
    println
    calls or
    ExecutorService.submit
    calls. I tried adding another rule and that did work...so maybe I've just got something misconfigured for
    ForbiddenMethodCall
    ?
    b
    gammax
    25 replies
    Copy to Clipboard
  • n

    nkiesel

    2 years ago
    How can I override settings from a global detekt settings in a module for a multi-module gradle build? Right now I have a
    detekt-config.yml
    in my root directory, and another detekt-config.ymlin my module directory. To use both, I use
    detekt { config = files("${project.rootDir}/detekt-config.yml", "detekt-config.yml") }
    . Is there a better way which e.g. does not require to repeat the base config file name or perhaps even a
    mergeConfigs: true
    which will automatically merge these? I tried
    detekt { config += files("detekt-config.yml") }
    but that did not work.
    n
    gammax
    2 replies
    Copy to Clipboard
  • b

    bbaldino

    2 years ago
    Does detekt have any built-in rules related to inconsistent synchronization? I'm trying to make a case for detekt over spotbugs, but this is a feature we've gotten from spotbugs and haven't found something similar in the detekt docs.
    b
    gammax
    +1
    8 replies
    Copy to Clipboard
  • Marco Righini

    Marco Righini

    2 years ago
    Hi everybody! What’s the way to overwrite the detekt autocorrect flag (defined in
    detekt
    block in the gradle file) with a command line gradle task parameter? I checked the docs but I didn’t find how. I’ve also tried
    ./gradlew detekt -Pauto-correct=true
    and
    ./gradlew detekt -PautoCorrect=true
    along with some other similar commands but none of them worked.
    Marco Righini
    b
    +1
    3 replies
    Copy to Clipboard
  • Rodrigo Silva

    Rodrigo Silva

    2 years ago
    Hi all. I'm getting this warning:
    detekt(DetektExtension.() -> Unit): Unit' is deprecated. Either apply detekt plugin to root project
    why? gradle version: 6.5 detekt version: 1.10.
    Rodrigo Silva
    gammax
    4 replies
    Copy to Clipboard
  • d

    dead.fish

    2 years ago
    Hi all! Are there any more sophisticated complexity checks that somebody wrote based on Detekt?
    ComplexMethod
    only works on single methods, but I’m looking for class and inter-class complexity calculation. Is this even possible with Detekt?
    d
    gammax
    2 replies
    Copy to Clipboard