Total Complexity | 0 |
Complexity/F | 0 |
Lines of Code | 41 |
Function Count | 0 |
Duplicated Lines | 41 |
Ratio | 100 % |
Changes | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | View Code Duplication | import testEnv from '../env/tests'; |
|
|
|||
2 | |||
3 | export default { |
||
4 | 'files' : [ '*.test.js', '**/tests/**' ], |
||
5 | 'env' : testEnv, |
||
6 | 'extends' : [ 'plugin:mocha/recommended' ], |
||
7 | 'rules' : { |
||
8 | 'prefer-arrow-callback' : 0, |
||
9 | 'no-magic-numbers' : 0, |
||
10 | |||
11 | 'security/detect-non-literal-regexp' : 0, |
||
12 | 'security/detect-non-literal-require' : 0, |
||
13 | |||
14 | 'import/named' : 0, |
||
15 | 'import/default' : 0, |
||
16 | |||
17 | 'mocha/no-global-tests' : 0, |
||
18 | 'mocha/no-top-level-hooks' : 0, |
||
19 | 'mocha/no-exports' : 0, |
||
20 | 'mocha/no-hooks-for-single-case' : 0, |
||
21 | |||
22 | 'unicorn/filename-case' : [ 'error', { |
||
23 | 'cases' : { |
||
24 | 'kebabCase' : true, |
||
25 | 'pascalCase' : true, |
||
26 | 'camelCase' : true // for testing camelCase utils |
||
27 | } |
||
28 | } ], |
||
29 | |||
30 | 'sonarjs/no-duplicate-string' : 0, |
||
31 | 'sonarjs/no-identical-functions' : 0, |
||
32 | |||
33 | 'security/detect-unsafe-regex' : 0, |
||
34 | 'unicorn/no-unsafe-regex' : 0, |
||
35 | |||
36 | 'node/no-unpublished-import' : 0, |
||
37 | 'node/no-unpublished-require' : 0, |
||
38 | |||
39 | 'regexp/no-super-linear-backtracking' : 0 |
||
40 | } |
||
41 | }; |
||
42 |