Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report model parsing updates #1668

Merged
merged 33 commits into from
Oct 7, 2019
Merged

Report model parsing updates #1668

merged 33 commits into from
Oct 7, 2019

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented Oct 7, 2019

Checklist:

When creating a ReportCve instance ensure that the used variables are
always defined.
Use App.fromElement for parsing an App from a Report. Update properties
of App to use consistent naming.
Use consistent naming for high results.
Use fromElement to parse a Report Host model.
Move initialization of values to the constructor and use camel case for
hosts by ip property.
Init hosts in constructor. Use camel case for host by id property.
Rename addSeverity to setSeverity and use new parser functions.
Use new functions for parsing. Init hosts in constructor. Use camel case
for host by ip information. Update setSeverity method.
Report TLS Certificates are a very special "model". It acts very
differently to the normal models because it is not generated from an xml
response element. It's data is collected from several host information
elements.
Update the setProperties function to allow overriding properties of the
object.
Use the fromElement static function to create new models to spot
possible side effects from running the parsing code.
Fix setSeverity method or Port by allowing to override all parsed
properties of the Model. The severity prop was parsed from the passed
element and therefore has been freezed.
Use ReportHosts.fromElement method to parse hosts and add test for
parsing an empty hosts list.
Use ReportPort.fromElement method to parse ports of a report and add
tests for parsing these ports.
Use fromElement to parse vulns from a report and add tests.
Use ReportApp fromElement to parse new app models and add tests for
parseApp.
Use ReportOperatingSystem fromElement method and add tests.
Add fromElement and parseElement methods to ReportTlsCertificate model.
Use constructor only to init the ports property.
Put the parsed port into the array of ports instead of the original one.
Use new fromElement method and add tests.
Don't parse report vulnerabilities of a report anymore. Remove unused
sort functions for reports vulnerabilities.
Drop the unused report vulnerability parsing code.
@codecov
Copy link

codecov bot commented Oct 7, 2019

Codecov Report

Merging #1668 into gsa-8.0 will increase coverage by 1.46%.
The diff coverage is 98.82%.

Impacted file tree graph

@@             Coverage Diff             @@
##           gsa-8.0    #1668      +/-   ##
===========================================
+ Coverage    37.64%   39.11%   +1.46%     
===========================================
  Files          966      965       -1     
  Lines        22116    22081      -35     
  Branches      6212     6231      +19     
===========================================
+ Hits          8326     8637     +311     
+ Misses       12465    12176     -289     
+ Partials      1325     1268      -57
Impacted Files Coverage Δ
gsa/src/gmp/models/report/report.js 0% <ø> (ø) ⬆️
gsa/src/gmp/models/report/task.js 100% <ø> (+100%) ⬆️
gsa/src/web/pages/reports/sort.js 25% <ø> (+1.19%) ⬆️
gsa/src/gmp/models/report/os.js 100% <100%> (+100%) ⬆️
gsa/src/gmp/parser.js 99.15% <100%> (+0.01%) ⬆️
gsa/src/gmp/models/report/cve.js 100% <100%> (ø) ⬆️
gsa/src/gmp/models/report/port.js 100% <100%> (+100%) ⬆️
gsa/src/gmp/models/report/host.js 98.38% <100%> (+51.01%) ⬆️
gsa/src/gmp/models/report/app.js 100% <100%> (+100%) ⬆️
gsa/src/gmp/models/report/parser.js 77.03% <100%> (+65.09%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53619ee...23f4d59. Read the comment docs.

@bjoernricks bjoernricks marked this pull request as ready for review October 7, 2019 12:47
@bjoernricks bjoernricks requested a review from a team October 7, 2019 12:47
@bjoernricks bjoernricks merged commit b58eb06 into greenbone:gsa-8.0 Oct 7, 2019
@bjoernricks bjoernricks deleted the report-model-parsing-updates branch October 7, 2019 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants