center-for-threat-informed-defense / attack-workbench-rest-api

An application allowing users to explore, create, annotate, and share extensions of the MITRE ATT&CK® knowledge base. This repository contains the REST API service for storing, querying, and editing ATT&CK objects.
https://ctid.mitre-engenuity.org/
Apache License 2.0
40 stars 22 forks source link

Refactored data components service #335

Closed vsun757 closed 8 months ago

codecov[bot] commented 8 months ago

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (9769f0b) 67.60% compared to head (434003f) 68.25%. Report is 66 commits behind head on project-orion.

Files Patch % Lines
app/controllers/data-components-controller.js 61.95% 35 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## project-orion #335 +/- ## ================================================= + Coverage 67.60% 68.25% +0.64% ================================================= Files 143 145 +2 Lines 17168 15997 -1171 Branches 2137 1936 -201 ================================================= - Hits 11607 10918 -689 + Misses 5554 5071 -483 - Partials 7 8 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ElJocko commented 8 months ago

Just a couple of things to clean up:

  1. I'm guessing that you really want to be using the 302-refactor-data-components-service-for-improved-structure-and-asynchronicity branch, since you merged the data-test-302 branch into that one (and that's the branch that I reviewed)
  2. You can delete the retrieveAllAsync() function from the data components service. That function was only created to provide an async version of the retrieveAll() function for the one place the data sources service needed it. Since the main retrieveAll() function is now async, the retrieveAllAsync() function isn't needed anymore.
  3. After deleting the retrieveAllAsync() function, the place in the data sources service that called it needs to be changed to call dataComponentsService.retrieveAll()
sonarcloud[bot] commented 8 months ago

Quality Gate Failed Quality Gate failed

Failed conditions

6.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud