-
Notifications
You must be signed in to change notification settings - Fork 18
Importer Rework - Fix Warnings #3877
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
Draft
Elutrixx
wants to merge
14
commits into
CactuseSecurity:importer-rework
Choose a base branch
from
Elutrixx:Fix-Warnings-Importer-Rework
base: importer-rework
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c30fa61
Fixed most imported rework warnings
Elutrixx 70f639e
more advanced warning fixes
Elutrixx e050e6e
Decluttering RuleTreeBuilder complexity
Elutrixx 03bb378
Further decluttering
Elutrixx 423a033
Catch nullable for sonarcube
Elutrixx 38d761a
Hide DeviceReport.ContainsRules()
Elutrixx 9193cee
Merge branch 'importer-rework' into Fix-Warnings-Importer-Rework
Elutrixx a25a22c
Merge branch 'importer-rework' into Fix-Warnings-Importer-Rework
Elutrixx 6356a15
Add Decommision Query
Elutrixx 25f781b
Improve code style
Elutrixx c2f23f1
Merge branch 'importer-rework' into Fix-Warnings-Importer-Rework
Elutrixx b658750
fix typo
Elutrixx 11c42c5
Merge remote-tracking branch 'cactus/importer-rework' into Fix-Warnin…
Elutrixx a94caff
Fix potential nullability warning
Elutrixx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,7 +94,7 @@ await smtp.ConnectAsync( | |
|
|
||
| return true; | ||
| } | ||
| catch (Exception e) | ||
| catch (Exception) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ public class ReportCompliance : ReportBase | |
| private readonly int _maxDegreeOfParallelism; | ||
| private readonly SemaphoreSlim _semaphore; | ||
| private readonly NatRuleDisplayHtml _natRuleDisplayHtml; | ||
| private List<string> _columnsToExport; | ||
| private List<string> _columnsToExport = []; | ||
| private bool _includeHeaderInExport; | ||
| private char _separator; | ||
| private int _maxCellSize; | ||
|
|
@@ -378,6 +378,10 @@ private Task GatherEmptyGroups(NetworkLocation[] networkLocations, List<NetworkL | |
|
|
||
| private Task<List<Rule>> GatherReportData((List<Rule> processed, List<RuleViewData> viewData)[]? results) | ||
| { | ||
| if (results == null) | ||
| { | ||
| results = []; | ||
| } | ||
| RuleViewData.Capacity = results.Sum(r => r.viewData.Count); | ||
| List<Rule> processedRulesFlat = new(results.Sum(r => r.processed.Count)); | ||
|
|
||
|
|
@@ -422,6 +426,7 @@ protected virtual Dictionary<string, object> CreateQueryVariables(int offset, in | |
| return queryVariables; | ||
| } | ||
|
|
||
| //TODO: Does this need to be async? | ||
| protected virtual async Task SetComplianceDataForRule(Rule rule, ApiConnection apiConnection, Func<ComplianceViolation, string>? formatter = null) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Robin-Smets Is this purposfully left as async? Directing this question at you as you took the awaited method out of the code block, but maybe there is a different reason this needs to be run asynchronously |
||
| { | ||
| try | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.