summaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/hbs/component-viewer/source.hbs
blob: 65d7165af2896fe9a724144bc71a6ba2e807a8d9 (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
63
<table class="code">
  <tr class="row row-hidden" data-line-number="0">
    {{#if settings.coverage}}
      <td class="stat coverage-tests"></td>
      <td class="stat coverage-conditions"></td>
    {{/if}}
    {{#if settings.duplications}}
      <td class="stat"></td>
    {{/if}}
    {{#if settings.scm}}
      <th class="stat"></th>
    {{/if}}
    <td class="stat lid"></td>
    <td class="line"></td>
  </tr>

  {{#each source}}
    {{#if show}}
      <tr class="row {{#if ../../settings.coverage}}{{#if coverageStatus}}coverage-{{coverageStatus}}{{/if}}{{/if}}"
          data-line-number="{{lineNumber}}">

        {{#if ../../settings.coverage}}
          <td class="stat coverage-tests">
            {{#if coverage}}
              <span title="Line is covered by {{coverage}} tests">{{coverage}}</span>
            {{/if}}
          </td>

          <td class="stat coverage-conditions">
              {{#if coverageConditions}}
                {{#if conditions}}
                  <span title="{{coverageConditions}} branches are covered by tests">
                    {{coverageConditions}}/{{conditions}}
                  </span>
                {{/if}}
              {{/if}}
          </td>
        {{/if}}

        {{#if ../../settings.duplications}}
          <td class="stat duplications">
            {{#each duplications}}
              <span class="duplication {{#if this}}duplication-exists{{/if}}"></span>
            {{/each}}
          </td>
        {{/if}}

        {{#if ../../settings.scm}}
          <td class="stat {{#if scm}}scm{{/if}}">
            {{#if scm}}
              <span class="scm-date">{{scm.date}}</span>
              <span class="scm-author" title="{{scm.author}}">{{scm.author}}</span>
            {{/if}}
          </td>
        {{/if}}

        <td class="stat lid">{{lineNumber}}</td>

        <td class="line"><pre>{{{code}}}</pre></td>
      </tr>
    {{/if}}
  {{/each}}
</table>