detekt.yml 11 KB

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