rudder icon indicating copy to clipboard operation
rudder copied to clipboard

Fixes #25088: Remove unused methods in ReportingService

Open fanf opened this issue 1 year ago • 0 comments

https://issues.rudder.io/issues/25088

Some well needed cleaning in ReportingService (first step, other will follow):

Getting only user/system compliance

A lot of code in reporting service is based on the pattern :

rules <- getRules(system = false) // only user rules
compliance <- computeComplianceForNodes(limitToRules = rules.map(_.id))

Or the same thing for system rule, getting all rules then diffing. This is not needed anymore since we have now a Map[PolicyTypeName, AggregatedStatusReport] now in NodeStatusReport.

Class methods when they can be object ones

ReportingService trait has several method that are not linked to service dependencies and can be moved to its companion object.

Unused methods/classes

Some methods were just unused anywhere: complianceByNode, systemComplianceByNode, NodeCompliance, NodeSystemCompliance.

fanf avatar Jun 29 '24 21:06 fanf