add summary to html report (#687)

This commit is contained in:
Marc Brugger 2021-08-19 14:53:39 +02:00 committed by GitHub
parent f285d612b5
commit aee782bfe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,15 @@ const templateContent = `
.tag {
width: 80px;
}
.summary-first {
padding: .75rem .75rem .1rem .75rem;
}
.summary-last {
padding: .1rem .75rem .75rem .75rem;
}
.summary {
padding: .1rem .75rem ;
}
</style>
</head>
<body>
@ -251,6 +260,7 @@ const templateContent = `
);
}.bind(this));
return (
<div>
<nav className="panel">
<div className="panel-heading">Filters</div>
<div className="panel-block">
@ -295,6 +305,44 @@ const templateContent = `
</div>
</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="column is-one-quarter">
<Navigation
data={ this.props.data }
severity={ this.state.severity }
confidence={ this.state.confidence }
issueType={ this.state.issueType }