detekt.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. build:
  2. maxIssues: 10
  3. weights:
  4. # complexity: 2
  5. # LongParameterList: 1
  6. # style: 1
  7. # comments: 1
  8. processors:
  9. active: true
  10. exclude:
  11. # - 'FunctionCountProcessor'
  12. # - 'PropertyCountProcessor'
  13. # - 'ClassCountProcessor'
  14. # - 'PackageCountProcessor'
  15. # - 'KtFileCountProcessor'
  16. console-reports:
  17. active: true
  18. exclude:
  19. # - 'ProjectStatisticsReport'
  20. # - 'ComplexityReport'
  21. # - 'NotificationReport'
  22. # - 'FindingsReport'
  23. # - 'BuildFailureReport'
  24. comments:
  25. active: true
  26. CommentOverPrivateFunction:
  27. active: false
  28. CommentOverPrivateProperty:
  29. active: false
  30. EndOfSentenceFormat:
  31. active: false
  32. endOfSentenceFormat: ([.?!][ \t\n\r\f<])|([.?!]$)
  33. UndocumentedPublicClass:
  34. active: false
  35. searchInNestedClass: true
  36. searchInInnerClass: true
  37. searchInInnerObject: true
  38. searchInInnerInterface: true
  39. UndocumentedPublicFunction:
  40. active: false
  41. complexity:
  42. active: true
  43. ComplexCondition:
  44. active: true
  45. threshold: 4
  46. ComplexInterface:
  47. active: false
  48. threshold: 10
  49. includeStaticDeclarations: false
  50. ComplexMethod:
  51. active: true
  52. threshold: 10
  53. ignoreSingleWhenExpression: false
  54. ignoreSimpleWhenEntries: false
  55. LabeledExpression:
  56. active: false
  57. ignoredLabels: ""
  58. LargeClass:
  59. active: true
  60. threshold: 600
  61. LongMethod:
  62. active: true
  63. threshold: 60
  64. LongParameterList:
  65. active: true
  66. threshold: 6
  67. ignoreDefaultParameters: false
  68. MethodOverloading:
  69. active: false
  70. threshold: 6
  71. NestedBlockDepth:
  72. active: true
  73. threshold: 4
  74. StringLiteralDuplication:
  75. active: false
  76. threshold: 3
  77. ignoreAnnotation: true
  78. excludeStringsWithLessThan5Characters: true
  79. ignoreStringsRegex: '$^'
  80. TooManyFunctions:
  81. active: true
  82. thresholdInFiles: 11
  83. thresholdInClasses: 11
  84. thresholdInInterfaces: 11
  85. thresholdInObjects: 11
  86. thresholdInEnums: 11
  87. ignoreDeprecated: false
  88. ignorePrivate: false
  89. ignoreOverridden: false
  90. empty-blocks:
  91. active: true
  92. EmptyCatchBlock:
  93. active: true
  94. allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
  95. EmptyClassBlock:
  96. active: true
  97. EmptyDefaultConstructor:
  98. active: true
  99. EmptyDoWhileBlock:
  100. active: true
  101. EmptyElseBlock:
  102. active: true
  103. EmptyFinallyBlock:
  104. active: true
  105. EmptyForBlock:
  106. active: true
  107. EmptyFunctionBlock:
  108. active: true
  109. ignoreOverridden: false
  110. EmptyIfBlock:
  111. active: true
  112. EmptyInitBlock:
  113. active: true
  114. EmptyKtFile:
  115. active: true
  116. EmptySecondaryConstructor:
  117. active: true
  118. EmptyWhenBlock:
  119. active: true
  120. EmptyWhileBlock:
  121. active: true
  122. exceptions:
  123. active: true
  124. ExceptionRaisedInUnexpectedLocation:
  125. active: false
  126. methodNames: 'toString,hashCode,equals,finalize'
  127. InstanceOfCheckForException:
  128. active: false
  129. NotImplementedDeclaration:
  130. active: false
  131. PrintStackTrace:
  132. active: false
  133. RethrowCaughtException:
  134. active: false
  135. ReturnFromFinally:
  136. active: false
  137. SwallowedException:
  138. active: false
  139. ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException'
  140. ThrowingExceptionFromFinally:
  141. active: false
  142. ThrowingExceptionInMain:
  143. active: false
  144. ThrowingExceptionsWithoutMessageOrCause:
  145. active: false
  146. exceptions: 'IllegalArgumentException,IllegalStateException,IOException'
  147. ThrowingNewInstanceOfSameException:
  148. active: false
  149. TooGenericExceptionCaught:
  150. active: true
  151. exceptionNames:
  152. - ArrayIndexOutOfBoundsException
  153. - Error
  154. - Exception
  155. - IllegalMonitorStateException
  156. - NullPointerException
  157. - IndexOutOfBoundsException
  158. - RuntimeException
  159. - Throwable
  160. allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
  161. TooGenericExceptionThrown:
  162. active: true
  163. exceptionNames:
  164. - Error
  165. - Exception
  166. - Throwable
  167. - RuntimeException
  168. formatting:
  169. active: true
  170. android: false
  171. ChainWrapping:
  172. active: true
  173. CommentSpacing:
  174. active: true
  175. Filename:
  176. active: true
  177. FinalNewline:
  178. active: true
  179. ImportOrdering:
  180. active: false
  181. Indentation:
  182. active: true
  183. indentSize: 4
  184. continuationIndentSize: 4
  185. MaximumLineLength:
  186. active: true
  187. maxLineLength: 120
  188. ModifierOrdering:
  189. active: true
  190. NoBlankLineBeforeRbrace:
  191. active: true
  192. NoConsecutiveBlankLines:
  193. active: true
  194. NoEmptyClassBody:
  195. active: true
  196. NoLineBreakAfterElse:
  197. active: true
  198. NoLineBreakBeforeAssignment:
  199. active: true
  200. NoMultipleSpaces:
  201. active: true
  202. NoSemicolons:
  203. active: true
  204. NoTrailingSpaces:
  205. active: true
  206. NoUnitReturn:
  207. active: true
  208. NoUnusedImports:
  209. active: true
  210. NoWildcardImports:
  211. active: true
  212. PackageName:
  213. active: true
  214. ParameterListWrapping:
  215. active: true
  216. indentSize: 4
  217. SpacingAroundColon:
  218. active: true
  219. SpacingAroundComma:
  220. active: true
  221. SpacingAroundCurly:
  222. active: true
  223. SpacingAroundKeyword:
  224. active: true
  225. SpacingAroundOperators:
  226. active: true
  227. SpacingAroundParens:
  228. active: true
  229. SpacingAroundRangeOperator:
  230. active: true
  231. StringTemplate:
  232. active: true
  233. naming:
  234. active: true
  235. ClassNaming:
  236. active: true
  237. classPattern: '[A-Z$][a-zA-Z0-9$]*'
  238. ConstructorParameterNaming:
  239. active: true
  240. parameterPattern: '[a-z][A-Za-z0-9]*'
  241. privateParameterPattern: '[a-z][A-Za-z0-9]*'
  242. excludeClassPattern: '$^'
  243. EnumNaming:
  244. active: true
  245. enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
  246. ForbiddenClassName:
  247. active: false
  248. forbiddenName: ''
  249. FunctionMaxLength:
  250. active: false
  251. maximumFunctionNameLength: 30
  252. FunctionMinLength:
  253. active: false
  254. minimumFunctionNameLength: 3
  255. FunctionNaming:
  256. active: true
  257. functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
  258. excludeClassPattern: '$^'
  259. ignoreOverridden: true
  260. FunctionParameterNaming:
  261. active: true
  262. parameterPattern: '[a-z][A-Za-z0-9]*'
  263. excludeClassPattern: '$^'
  264. ignoreOverridden: true
  265. MatchingDeclarationName:
  266. active: true
  267. MemberNameEqualsClassName:
  268. active: false
  269. ignoreOverridden: true
  270. ObjectPropertyNaming:
  271. active: true
  272. constantPattern: '[A-Za-z][_A-Za-z0-9]*'
  273. propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
  274. privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
  275. PackageNaming:
  276. active: true
  277. packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
  278. TopLevelPropertyNaming:
  279. active: true
  280. constantPattern: '[A-Z][_A-Z0-9]*'
  281. propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
  282. privatePropertyPattern: '(_)?[A-Za-z][A-Za-z0-9]*'
  283. VariableMaxLength:
  284. active: false
  285. maximumVariableNameLength: 64
  286. VariableMinLength:
  287. active: false
  288. minimumVariableNameLength: 1
  289. VariableNaming:
  290. active: true
  291. variablePattern: '[a-z][A-Za-z0-9]*'
  292. privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
  293. excludeClassPattern: '$^'
  294. ignoreOverridden: true
  295. performance:
  296. active: true
  297. ArrayPrimitive:
  298. active: false
  299. ForEachOnRange:
  300. active: true
  301. SpreadOperator:
  302. active: true
  303. UnnecessaryTemporaryInstantiation:
  304. active: true
  305. potential-bugs:
  306. active: true
  307. DuplicateCaseInWhenExpression:
  308. active: true
  309. EqualsAlwaysReturnsTrueOrFalse:
  310. active: false
  311. EqualsWithHashCodeExist:
  312. active: true
  313. ExplicitGarbageCollectionCall:
  314. active: true
  315. InvalidRange:
  316. active: false
  317. IteratorHasNextCallsNextMethod:
  318. active: false
  319. IteratorNotThrowingNoSuchElementException:
  320. active: false
  321. LateinitUsage:
  322. active: false
  323. excludeAnnotatedProperties: ""
  324. ignoreOnClassesPattern: ""
  325. UnconditionalJumpStatementInLoop:
  326. active: false
  327. UnreachableCode:
  328. active: true
  329. UnsafeCallOnNullableType:
  330. active: false
  331. UnsafeCast:
  332. active: false
  333. UselessPostfixExpression:
  334. active: false
  335. WrongEqualsTypeParameter:
  336. active: false
  337. style:
  338. active: true
  339. CollapsibleIfStatements:
  340. active: false
  341. DataClassContainsFunctions:
  342. active: false
  343. conversionFunctionPrefix: 'to'
  344. EqualsNullCall:
  345. active: false
  346. EqualsOnSignatureLine:
  347. active: false
  348. ExplicitItLambdaParameter:
  349. active: false
  350. ExpressionBodySyntax:
  351. active: false
  352. includeLineWrapping: false
  353. ForbiddenComment:
  354. active: true
  355. values: 'TODO:,FIXME:,STOPSHIP:'
  356. ForbiddenImport:
  357. active: false
  358. imports: ''
  359. ForbiddenVoid:
  360. active: false
  361. FunctionOnlyReturningConstant:
  362. active: false
  363. ignoreOverridableFunction: true
  364. excludedFunctions: 'describeContents'
  365. LoopWithTooManyJumpStatements:
  366. active: false
  367. maxJumpCount: 1
  368. MagicNumber:
  369. active: true
  370. ignoreNumbers: '-1,0,1,2'
  371. ignoreHashCodeFunction: true
  372. ignorePropertyDeclaration: false
  373. ignoreConstantDeclaration: true
  374. ignoreCompanionObjectPropertyDeclaration: true
  375. ignoreAnnotation: false
  376. ignoreNamedArgument: true
  377. ignoreEnums: false
  378. excludes: "**/*Test.kt"
  379. MandatoryBracesIfStatements:
  380. active: false
  381. MaxLineLength:
  382. active: true
  383. maxLineLength: 120
  384. excludePackageStatements: true
  385. excludeImportStatements: true
  386. excludeCommentStatements: false
  387. MayBeConst:
  388. active: false
  389. ModifierOrder:
  390. active: true
  391. NestedClassesVisibility:
  392. active: false
  393. NewLineAtEndOfFile:
  394. active: true
  395. NoTabs:
  396. active: false
  397. OptionalAbstractKeyword:
  398. active: true
  399. OptionalUnit:
  400. active: false
  401. OptionalWhenBraces:
  402. active: false
  403. PreferToOverPairSyntax:
  404. active: false
  405. ProtectedMemberInFinalClass:
  406. active: false
  407. RedundantVisibilityModifierRule:
  408. active: false
  409. ReturnCount:
  410. active: true
  411. max: 2
  412. excludedFunctions: "equals"
  413. excludeLabeled: false
  414. excludeReturnFromLambda: true
  415. SafeCast:
  416. active: true
  417. SerialVersionUIDInSerializableClass:
  418. active: false
  419. SpacingBetweenPackageAndImports:
  420. active: false
  421. ThrowsCount:
  422. active: true
  423. max: 2
  424. TrailingWhitespace:
  425. active: false
  426. UnderscoresInNumericLiterals:
  427. active: false
  428. acceptableDecimalLength: 5
  429. UnnecessaryAbstractClass:
  430. active: false
  431. excludeAnnotatedClasses: "dagger.Module"
  432. UnnecessaryApply:
  433. active: false
  434. UnnecessaryInheritance:
  435. active: false
  436. UnnecessaryLet:
  437. active: false
  438. UnnecessaryParentheses:
  439. active: false
  440. UntilInsteadOfRangeTo:
  441. active: false
  442. UnusedImports:
  443. active: false
  444. UnusedPrivateClass:
  445. active: false
  446. UnusedPrivateMember:
  447. active: false
  448. allowedNames: "(_|ignored|expected|serialVersionUID)"
  449. UseDataClass:
  450. active: false
  451. excludeAnnotatedClasses: ""
  452. UtilityClassWithPublicConstructor:
  453. active: false
  454. VarCouldBeVal:
  455. active: false
  456. WildcardImport:
  457. active: true
  458. excludeImports: 'java.util.*,kotlinx.android.synthetic.*'