Codice non raggiungibile
Questa categoria di avviso viene indicata da qmllint come " [unreachable-code] ".
Codice non raggiungibile
Cosa è successo?
Le istruzioni presenti nel codice sono irraggiungibili e non verranno mai eseguite.
Perché è un problema?
Il codice irraggiungibile non contribuisce alla logica del programma e appesantisce l'impronta su disco e in memoria dell'applicazione. Il codice irraggiungibile può essere un segno di bug sottostanti o di errori di logica.
Esempio
function f(b: bool) : string {
if (b)
return "true"
else
return "false"
return "something else??" // unreachable statement
}Per risolvere questo avviso, rimuovi le istruzioni non eseguibili oppure rifattorizza il codice in modo da rendere accessibile tutta la logica.
function f(b: bool) : string {
if (b)
return "true"
else
return "false"
}© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.