@@ -19,7 +19,7 @@ const templateContent = `
19
19
<html lang="en">
20
20
<head>
21
21
<meta charset="utf-8">
22
- <title>Go AST Scanner </title>
22
+ <title>Golang Security Checker </title>
23
23
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.2.1/css/bulma.min.css" integrity="sha256-DRcOKg8NK1KkSkcymcGmxOtS/lAn0lHWJXRa15gMHHk=" crossorigin="anonymous"/>
24
24
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.min.js" integrity="sha256-cLWs9L+cjZg8CjGHMpJqUgKKouPlmoMP/0wIdPtaPGs=" crossorigin="anonymous"></script>
25
25
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.min.js" integrity="sha256-JIW8lNqN2EtqC6ggNZYnAdKMJXRQfkPMvdRt+b0/Jxc=" crossorigin="anonymous"></script>
@@ -89,9 +89,7 @@ const templateContent = `
89
89
</p>
90
90
<figure className="highlight">
91
91
<pre>
92
- <code className="golang hljs">
93
- { this.props.data.code }
94
- </code>
92
+ <code className="go">{ this.props.data.code }</code>
95
93
</pre>
96
94
</figure>
97
95
</div>
@@ -103,7 +101,7 @@ const templateContent = `
103
101
render: function() {
104
102
return (
105
103
<p className="help">
106
- Scanned { this.props.data.Stats.files.toLocaleString() } files
104
+ Gosec {this.props.data.GosecVersion} scanned { this.props.data.Stats.files.toLocaleString() } files
107
105
with { this.props.data.Stats.lines.toLocaleString() } lines of code.
108
106
{ this.props.data.Stats.nosec ? '\n' + this.props.data.Stats.nosec.toLocaleString() + ' false positives (nosec) have been waived.' : ''}
109
107
</p>
@@ -170,7 +168,6 @@ const templateContent = `
170
168
);
171
169
}
172
170
});
173
-
174
171
var LevelSelector = React.createClass({
175
172
handleChange: function(level) {
176
173
return function(e) {
@@ -183,30 +180,34 @@ const templateContent = `
183
180
}.bind(this);
184
181
},
185
182
render: function() {
186
- var highDisabled = !this.props.available.includes("HIGH");
187
- var mediumDisabled = !this.props.available.includes("MEDIUM");
188
- var lowDisabled = !this.props.available.includes("LOW");
189
- var on = "", off = "disabled";
190
183
var HIGH = "HIGH", MEDIUM = "MEDIUM", LOW = "LOW";
184
+ var highDisabled = !this.props.available.includes(HIGH);
185
+ var mediumDisabled = !this.props.available.includes(MEDIUM);
186
+ var lowDisabled = !this.props.available.includes(LOW);
187
+ var on = "", off = "disabled";
188
+ var baseClassName = "label checkbox ";
189
+ var highClassName = baseClassName + (highDisabled ? off : on);
190
+ var mediumClassName = baseClassName + (mediumDisabled ? off : on);
191
+ var lowClassName = baseClassName + (lowDisabled ? off : on);
191
192
return (
192
193
<span>
193
- <label className="label checkbox { (highDisabled ? off : on )}" >
194
+ <label className={ highClassName } >
194
195
<input
195
196
type="checkbox"
196
197
checked={ this.props.selected.includes(HIGH) }
197
198
disabled={ highDisabled }
198
199
onChange={ this.handleChange(HIGH) }/>
199
200
High
200
201
</label>
201
- <label className="label checkbox {( mediumDisabled ? off : on )}" >
202
+ <label className={mediumClassName} >
202
203
<input
203
204
type="checkbox"
204
205
checked={ this.props.selected.includes(MEDIUM) }
205
206
disabled={ mediumDisabled }
206
207
onChange={ this.handleChange(MEDIUM) }/>
207
208
Medium
208
209
</label>
209
- <label className="label checkbox {( lowDisabled ? off : on )}" >
210
+ <label className={lowClassName} >
210
211
<input
211
212
type="checkbox"
212
213
checked={ this.props.selected.includes(LOW) }
@@ -218,7 +219,6 @@ const templateContent = `
218
219
);
219
220
}
220
221
});
221
-
222
222
var Navigation = React.createClass({
223
223
updateSeverity: function(vals) {
224
224
this.props.onSeverity(vals);
@@ -276,12 +276,14 @@ const templateContent = `
276
276
</strong>
277
277
</div>
278
278
<div className="panel-block">
279
- <select onChange={ this.updateIssueType }>
280
- <option value="all" selected={ !this.props.issueType }>
281
- (all)
282
- </option>
283
- { issueTypes }
284
- </select>
279
+ <div className="select">
280
+ <select onChange={ this.updateIssueType }>
281
+ <option value="all" selected={ !this.props.issueType }>
282
+ (all)
283
+ </option>
284
+ { issueTypes }
285
+ </select>
286
+ </div>
285
287
</div>
286
288
</nav>
287
289
);
@@ -353,11 +355,9 @@ const templateContent = `
353
355
.filter(function(item, pos, ary) {
354
356
return !pos || item != ary[pos - 1];
355
357
});
356
-
357
358
if (this.state.issueType && !allTypes.includes(this.state.issueType)) {
358
359
this.setState({issueType: null});
359
360
}
360
-
361
361
this.setState({allIssueTypes: allTypes});
362
362
},
363
363
render: function() {
0 commit comments