detekt.yml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  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: 15
  83. thresholdInClasses: 15
  84. thresholdInInterfaces: 15
  85. thresholdInObjects: 15
  86. thresholdInEnums: 11
  87. ignoreDeprecated: true
  88. ignorePrivate: false
  89. ignoreOverridden: true
  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. excludes: "**/*Test.kt"
  261. FunctionParameterNaming:
  262. active: true
  263. parameterPattern: '[a-z][A-Za-z0-9]*'
  264. excludeClassPattern: '$^'
  265. ignoreOverridden: true
  266. MatchingDeclarationName:
  267. active: true
  268. MemberNameEqualsClassName:
  269. active: false
  270. ignoreOverridden: true
  271. ObjectPropertyNaming:
  272. active: true
  273. constantPattern: '[A-Za-z][_A-Za-z0-9]*'
  274. propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
  275. privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
  276. PackageNaming:
  277. active: true
  278. packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
  279. TopLevelPropertyNaming:
  280. active: true
  281. constantPattern: '[A-Z][_A-Z0-9]*'
  282. propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
  283. privatePropertyPattern: '(_)?[A-Za-z][A-Za-z0-9]*'
  284. VariableMaxLength:
  285. active: false
  286. maximumVariableNameLength: 64
  287. VariableMinLength:
  288. active: false
  289. minimumVariableNameLength: 1
  290. VariableNaming:
  291. active: true
  292. variablePattern: '[a-z][A-Za-z0-9]*'
  293. privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
  294. excludeClassPattern: '$^'
  295. ignoreOverridden: true
  296. performance:
  297. active: true
  298. ArrayPrimitive:
  299. active: false
  300. ForEachOnRange:
  301. active: true
  302. SpreadOperator:
  303. active: true
  304. UnnecessaryTemporaryInstantiation:
  305. active: true
  306. potential-bugs:
  307. active: true
  308. DuplicateCaseInWhenExpression:
  309. active: true
  310. EqualsAlwaysReturnsTrueOrFalse:
  311. active: false
  312. EqualsWithHashCodeExist:
  313. active: true
  314. ExplicitGarbageCollectionCall:
  315. active: true
  316. InvalidRange:
  317. active: false
  318. IteratorHasNextCallsNextMethod:
  319. active: false
  320. IteratorNotThrowingNoSuchElementException:
  321. active: false
  322. LateinitUsage:
  323. active: false
  324. excludeAnnotatedProperties: ""
  325. ignoreOnClassesPattern: ""
  326. UnconditionalJumpStatementInLoop:
  327. active: false
  328. UnreachableCode:
  329. active: true
  330. UnsafeCallOnNullableType:
  331. active: false
  332. UnsafeCast:
  333. active: false
  334. UselessPostfixExpression:
  335. active: false
  336. WrongEqualsTypeParameter:
  337. active: false
  338. style:
  339. active: true
  340. CollapsibleIfStatements:
  341. active: false
  342. DataClassContainsFunctions:
  343. active: false
  344. conversionFunctionPrefix: 'to'
  345. EqualsNullCall:
  346. active: false
  347. EqualsOnSignatureLine:
  348. active: false
  349. ExplicitItLambdaParameter:
  350. active: false
  351. ExpressionBodySyntax:
  352. active: false
  353. includeLineWrapping: false
  354. ForbiddenComment:
  355. active: true
  356. values: 'TODO:,FIXME:,STOPSHIP:'
  357. ForbiddenImport:
  358. active: false
  359. imports: ''
  360. ForbiddenVoid:
  361. active: false
  362. FunctionOnlyReturningConstant:
  363. active: false
  364. ignoreOverridableFunction: true
  365. excludedFunctions: 'describeContents'
  366. LoopWithTooManyJumpStatements:
  367. active: false
  368. maxJumpCount: 1
  369. MagicNumber:
  370. active: true
  371. ignoreNumbers: '-1,0,1,2'
  372. ignoreHashCodeFunction: true
  373. ignorePropertyDeclaration: false
  374. ignoreConstantDeclaration: true
  375. ignoreCompanionObjectPropertyDeclaration: true
  376. ignoreAnnotation: false
  377. ignoreNamedArgument: true
  378. ignoreEnums: false
  379. excludes: "**/*Test.kt"
  380. MandatoryBracesIfStatements:
  381. active: false
  382. MaxLineLength:
  383. active: true
  384. maxLineLength: 120
  385. excludePackageStatements: true
  386. excludeImportStatements: true
  387. excludeCommentStatements: false
  388. MayBeConst:
  389. active: false
  390. ModifierOrder:
  391. active: true
  392. NestedClassesVisibility:
  393. active: false
  394. NewLineAtEndOfFile:
  395. active: true
  396. NoTabs:
  397. active: false
  398. OptionalAbstractKeyword:
  399. active: true
  400. OptionalUnit:
  401. active: false
  402. OptionalWhenBraces:
  403. active: false
  404. PreferToOverPairSyntax:
  405. active: false
  406. ProtectedMemberInFinalClass:
  407. active: false
  408. RedundantVisibilityModifierRule:
  409. active: false
  410. ReturnCount:
  411. active: true
  412. max: 2
  413. excludedFunctions: "equals"
  414. excludeLabeled: false
  415. excludeReturnFromLambda: true
  416. SafeCast:
  417. active: true
  418. SerialVersionUIDInSerializableClass:
  419. active: false
  420. SpacingBetweenPackageAndImports:
  421. active: false
  422. ThrowsCount:
  423. active: true
  424. max: 2
  425. TrailingWhitespace:
  426. active: false
  427. UnderscoresInNumericLiterals:
  428. active: false
  429. acceptableDecimalLength: 5
  430. UnnecessaryAbstractClass:
  431. active: false
  432. excludeAnnotatedClasses: "dagger.Module"
  433. UnnecessaryApply:
  434. active: false
  435. UnnecessaryInheritance:
  436. active: false
  437. UnnecessaryLet:
  438. active: false
  439. UnnecessaryParentheses:
  440. active: false
  441. UntilInsteadOfRangeTo:
  442. active: false
  443. UnusedImports:
  444. active: false
  445. UnusedPrivateClass:
  446. active: false
  447. UnusedPrivateMember:
  448. active: false
  449. allowedNames: "(_|ignored|expected|serialVersionUID)"
  450. UseDataClass:
  451. active: false
  452. excludeAnnotatedClasses: ""
  453. UtilityClassWithPublicConstructor:
  454. active: false
  455. VarCouldBeVal:
  456. active: false
  457. WildcardImport:
  458. active: true
  459. excludeImports: 'java.util.*,kotlinx.android.synthetic.*'