aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/views/project/exclusions.html.erb
blob: 8941c3fff64c22d989739c3b2a145a0e4b3a07ba (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<h1><%= message('project_exclusions.page') -%></h1>

<p style="margin: 15px 0px">
  Exclude sources from code analysis. Changes will be applied during next code analysis.
</p>

<div class="yui-g widget" id="widget_exclusions">

  <div class="yui-u first">
    <% form_for( 'set_exclusions', :url => { :action => 'set_exclusions', :id => @project.id } ) do |form| 
       pattern_index=0
    %>
    <table class="spaced">
      <% patterns = Property.value('sonar.exclusions', @project.id, '').split(',')
         patterns.each do |pattern|
      %>
      <tr>
        <td class=left>
          <input id="exclusion_pattern_<%= pattern_index -%>" name="patterns[]" size="50" value="<%= pattern -%>" type="text">
        </td>
      </tr>
      <%  pattern_index += 1
         end
      %>
      <tr><td class=left>
        <input name="patterns[]" size="50" value="" type="text" id="exclusion_pattern_<%= pattern_index-%>">
      </td></tr>
      <tr><td class=left>
        <input name="patterns[]" size="50" value="" type="text" id="exclusion_pattern_<%= pattern_index + 1-%>"><br/>
      </td></tr>
      <tr><td class=left>
        <%= submit_tag( "Save exclusion filters", :id => 'submit_exclusions') %>
        <input type="submit" value="Delete all exclusion filters" id="delete_exclusions" class="action red-button"
               onclick="if (confirm('Are you sure you want to delete all exclusion filters ?')) { var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = '<%= url_for :action => "delete_exclusions", :id => @project.id -%>';f.submit(); };return false;">
        </td></tr>
    </table>
    <% end %>
  </div>

  <div class="yui-u">
    <div class="help">
      <h2>Wildcards</h2>
      <p>
      Following rules are applied:
      <table class="data">
        <thead><tr><th colspan="2"></th></tr></thead>
        <tr class="odd">
          <td>*</td>
          <td>Match zero or more characters</td>
        </tr>
        <tr class="even">
          <td>**</td>
          <td>Match zero or more directories</td>
        </tr>
        <tr class="odd">
          <td>?</td>
          <td>Match a single character</td>
        </tr>
      </table>
      </p>
      <p>
      Examples:
      <table class="data">
        <thead>
        <tr>
          <th>Filter</th>
          <th>Description</th>
          <th>Matches</th>
        </tr>
        </thead>
        <tr class="odd">
          <td>org/mycompany/*.java</td>
          <td>matches all <code>.java</code> files in the <code>org/mycompany</code> directory</td>
          <td><ul>
            <li>org/mycompany/Foo.java</li>
            <li>org/mycompany/Bar.java</li>
          </ul></td>
        </tr>
        <tr class="even">
          <td>org/*Model*.java</td>
          <td>matches all <code>.java</code> files with <code>Model</code> in filename and in the <code>org</code> directory</td>
          <td><ul>
            <li>org/Model.java</li>
            <li>org/FirstModel.java</li>
            <li>org/ModelTest.java</li>
          </ul></td>
        </tr>
        <tr class="odd">
          <td>org/**</td>
          <td>matches all files underneath the <code>org</code> directory</td>
          <td><ul>
            <li>org/Foo.java</li>
            <li>org/foo/bar.jsp</li>
          </ul></td>
        </tr>
        <tr class="even">
          <td>org/**/Dummy.java</td>
          <td>matches all <code>Dummy.java</code> files underneath the <code>org</code> directory</td>
          <td><ul>
            <li>org/Dummy.java</li>
            <li>org/foo/Dummy.java</li>
            <li>org/foo/bar/Dummy.java</li>
          </ul></td>
        </tr>
        <tr class="odd">
          <td>org/**/*.java</td>
          <td>matches all <code>.java</code> files underneath the <code>org</code> directory</td>
          <td><ul>
            <li>org/Foo.java</li>
            <li>org/foo/Bar.java</li>
            <li>org/foo/bar/Baz.java</li>
          </ul></td>
        </tr>
      </table>
      </p>
    </div>
  </div>
</div>