Welcome to mirror list, hosted at ThFree Co, Russian Federation.

diff_code_quality.js « mock_data « diffs « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: befab3b676b40c8f47d158cc2b829474b89e7145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
export const multipleFindingsArr = [
  {
    severity: 'minor',
    description: 'Unexpected Debugger Statement.',
    line: 2,
  },
  {
    severity: 'major',
    description:
      'Function `aVeryLongFunction` has 52 lines of code (exceeds 25 allowed). Consider refactoring.',
    line: 3,
  },
  {
    severity: 'minor',
    description: 'Arrow function has too many statements (52). Maximum allowed is 30.',
    line: 3,
  },
];

export const multipleFindings = {
  filePath: 'index.js',
  codequality: multipleFindingsArr,
};

export const singularFinding = {
  filePath: 'index.js',
  codequality: [multipleFindingsArr[0]],
};

export const diffCodeQuality = {
  diffFile: { file_hash: '123' },
  diffLines: [
    {
      left: {
        type: 'old',
        old_line: 1,
        new_line: null,
        codequality: [],
        lineDrafts: [],
      },
    },
    {
      left: {
        type: null,
        old_line: 2,
        new_line: 1,
        codequality: [],
        lineDrafts: [],
      },
    },
    {
      left: {
        type: 'new',
        old_line: null,
        new_line: 2,

        codequality: [multipleFindingsArr[0]],
        lineDrafts: [],
      },
    },
  ],
};