mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 03:55:54 +00:00
add summary to html report (#687)
This commit is contained in:
parent
f285d612b5
commit
aee782bfe8
1 changed files with 93 additions and 44 deletions
|
@ -41,6 +41,15 @@ const templateContent = `
|
||||||
.tag {
|
.tag {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
|
.summary-first {
|
||||||
|
padding: .75rem .75rem .1rem .75rem;
|
||||||
|
}
|
||||||
|
.summary-last {
|
||||||
|
padding: .1rem .75rem .75rem .75rem;
|
||||||
|
}
|
||||||
|
.summary {
|
||||||
|
padding: .1rem .75rem ;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -251,50 +260,89 @@ const templateContent = `
|
||||||
);
|
);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
return (
|
return (
|
||||||
<nav className="panel">
|
<div>
|
||||||
<div className="panel-heading">Filters</div>
|
<nav className="panel">
|
||||||
<div className="panel-block">
|
<div className="panel-heading">Filters</div>
|
||||||
<div className="field is-horizontal">
|
<div className="panel-block">
|
||||||
<div className="field-label is-normal">
|
<div className="field is-horizontal">
|
||||||
<label className="label is-pulled-left">Severity</label>
|
<div className="field-label is-normal">
|
||||||
</div>
|
<label className="label is-pulled-left">Severity</label>
|
||||||
<div className="field-body">
|
</div>
|
||||||
<LevelSelector selected={ this.props.severity } available={ this.props.allSeverities } onChange={ this.updateSeverity } />
|
<div className="field-body">
|
||||||
</div>
|
<LevelSelector selected={ this.props.severity } available={ this.props.allSeverities } onChange={ this.updateSeverity } />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="panel-block">
|
</div>
|
||||||
<div className="field is-horizontal">
|
<div className="panel-block">
|
||||||
<div className="field-label is-normal">
|
<div className="field is-horizontal">
|
||||||
<label className="label is-pulled-left">Confidence</label>
|
<div className="field-label is-normal">
|
||||||
</div>
|
<label className="label is-pulled-left">Confidence</label>
|
||||||
<div className="field-body">
|
</div>
|
||||||
<LevelSelector selected={ this.props.confidence } available={ this.props.allConfidences } onChange={ this.updateConfidence } />
|
<div className="field-body">
|
||||||
</div>
|
<LevelSelector selected={ this.props.confidence } available={ this.props.allConfidences } onChange={ this.updateConfidence } />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="panel-block">
|
</div>
|
||||||
<div className="field is-horizontal">
|
<div className="panel-block">
|
||||||
<div className="field-label is-normal">
|
<div className="field is-horizontal">
|
||||||
<label className="label is-pulled-left">Issue type</label>
|
<div className="field-label is-normal">
|
||||||
</div>
|
<label className="label is-pulled-left">Issue type</label>
|
||||||
<div className="field-body">
|
</div>
|
||||||
<div className="field">
|
<div className="field-body">
|
||||||
<div className="control">
|
<div className="field">
|
||||||
<div className="select is-fullwidth">
|
<div className="control">
|
||||||
<select onChange={ this.updateIssueType }>
|
<div className="select is-fullwidth">
|
||||||
<option value="all" selected={ !this.props.issueType }>
|
<select onChange={ this.updateIssueType }>
|
||||||
(all)
|
<option value="all" selected={ !this.props.issueType }>
|
||||||
</option>
|
(all)
|
||||||
{ issueTypes }
|
</option>
|
||||||
</select>
|
{ issueTypes }
|
||||||
</div>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</div>
|
||||||
|
</nav>
|
||||||
|
<nav className="panel">
|
||||||
|
<div className="panel-heading">Summary</div>
|
||||||
|
<div className="panel-block">
|
||||||
|
<div className="columns is-multiline">
|
||||||
|
<div className="column is-half summary-first">
|
||||||
|
<label className="label is-pulled-left">Gosec: </label>
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary-first">
|
||||||
|
{this.props.data.GosecVersion}
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary">
|
||||||
|
<label className="label is-pulled-left">Files: </label>
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary">
|
||||||
|
{this.props.data.Stats.files.toLocaleString()}
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary">
|
||||||
|
<label className="label is-pulled-left">Lines: </label>
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary">
|
||||||
|
{this.props.data.Stats.lines.toLocaleString()}
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary">
|
||||||
|
<label className="label is-pulled-left">Nosec: </label>
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary">
|
||||||
|
{this.props.data.Stats.nosec.toLocaleString()}
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary-last">
|
||||||
|
<label className="label is-pulled-left">Issues: </label>
|
||||||
|
</div>
|
||||||
|
<div className="column is-half summary-last">
|
||||||
|
{this.props.data.Stats.found.toLocaleString()}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -375,6 +423,7 @@ const templateContent = `
|
||||||
<div className="columns">
|
<div className="columns">
|
||||||
<div className="column is-one-quarter">
|
<div className="column is-one-quarter">
|
||||||
<Navigation
|
<Navigation
|
||||||
|
data={ this.props.data }
|
||||||
severity={ this.state.severity }
|
severity={ this.state.severity }
|
||||||
confidence={ this.state.confidence }
|
confidence={ this.state.confidence }
|
||||||
issueType={ this.state.issueType }
|
issueType={ this.state.issueType }
|
||||||
|
|
Loading…
Reference in a new issue