Files
codeql/csharp/ql/src/Dead Code/UnusedMethod.ql
2022-09-26 14:01:39 +02:00

24 lines
558 B
Plaintext

/**
* @name Unused method
* @description Finds private methods that seem to never be used, or solely used from other dead methods
* @kind problem
* @problem.severity warning
* @precision low
* @id cs/unused-method
* @tags efficiency
* maintainability
* useless-code
* external/cwe/cwe-561
*/
import csharp
import DeadCode
from Method m
where
not extractionIsStandalone() and
m.fromSource() and
isDeadMethod(m) and
not m.getDeclaringType().isPartial()
select m, "Unused method (or method called from dead method only)."