3

I tried to generate code report using detekt and when execute the below command in terminal

gradle detekt

it showing build failed with below message.

* What went wrong:
Execution failed for task ':app:detekt'.
> Build failed with 395 weighted issues.
weston
  • 54,145
  • 21
  • 145
  • 203
Thamarai Selvan
  • 131
  • 1
  • 6
  • You have **395 issues** you need to resolve, try running it using android studio and you will find the issues like [this](https://imgur.com/NrDbVsp) – Mohamed Hamdy Dec 30 '20 at 11:28
  • All issues should be printed explicitely in your log. Solve them or ignore them. At the beginning you could put them into a detekt-baseline file. You can configure it and run `./gradlew detektBaseline`, after that detekt will ignore those existing issues. – ChristianB Dec 30 '20 at 11:33

1 Answers1

3

As others have said in the comments, this means you have 395 issues in your code (kind of like lint warnings).

Detekt has a maxissues: property that determines whether or not to fail the build if your issues surpass the allowed number of maxissues. What I did was search the whole project for maxissues, which will take you to your detekt-config.yml or default-detekt-config.yml. There, you can change your maxissues to whatever you want.

In our old code base, we had 900 some issues, so I changed mine from maxissues:0 to masissues:1000. As we clean up the code, I hope to bring that number down.

Jeff Padgett
  • 2,380
  • 22
  • 34