File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414### Changed
1515- ` DuplicatedImport ` and ` TransitiveImport ` : Don't check internal stdlib imports
1616- ` ZeroAddress ` and ` ConstantAddress ` : Ignore uses in comparisons: Issue [ #384 ] ( https://github.com/nowarp/misti/issues/384 )
17+ - Warn if one of the disabled detectors (` -dd ` ) is unused: Issue [ #393 ] ( https://github.com/nowarp/misti/issues/393 )
1718
1819### Fixed
1920- ` ImportGraph ` : Set correct file paths of import nodes for ` .func ` files: PR [ #381 ] ( https://github.com/nowarp/misti/pull/381 )
Original file line number Diff line number Diff line change @@ -272,10 +272,12 @@ export class Driver {
272272 * @throws Error if a detector class cannot be found in the specified module or as a built-in.
273273 */
274274 async initializeDetectors ( ) : Promise < void > {
275+ const usedDisabledDetectors = new Set < string > ( ) ;
275276 const detectorPromises = this . ctx . config . detectors . reduce <
276277 Promise < Detector | null > [ ]
277278 > ( ( acc , config ) => {
278279 if ( this . disabledDetectors . has ( config . className ) ) {
280+ usedDisabledDetectors . add ( config . className ) ;
279281 this . ctx . logger . debug ( `Suppressed detector: ${ config . className } ` ) ;
280282 return acc ;
281283 }
@@ -311,6 +313,16 @@ export class Driver {
311313 this . ctx . logger . debug (
312314 `Enabled detectors (${ this . detectors . length } ): ${ this . detectors . map ( ( d ) => d . id ) . join ( ", " ) } ` ,
313315 ) ;
316+
317+ // Warn about unused disabled detectors
318+ const unusedDisabledDetectors = [ ...this . disabledDetectors ] . filter (
319+ ( detector ) => ! usedDisabledDetectors . has ( detector ) ,
320+ ) ;
321+ if ( unusedDisabledDetectors . length > 0 ) {
322+ this . ctx . logger . warn (
323+ `The following disabled detectors were never encountered: ${ unusedDisabledDetectors . join ( ", " ) } ` ,
324+ ) ;
325+ }
314326 }
315327
316328 /**
You can’t perform that action at this time.
0 commit comments