- Auslisten aller im Projekt definierten Funktionen
- Suche nach toten Funktionen im Projekt - Doppelklick auf Funktion öffnet die Datei mit der Deklaration
This commit is contained in:
39
src/editor/DeadCodeAnalyzer.h
Normal file
39
src/editor/DeadCodeAnalyzer.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QList>
|
||||
|
||||
#include "FunctionScanner.h"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// DeadCodeAnalyzer – Findet Funktionen die definiert aber nie aufgerufen werden.
|
||||
// ---------------------------------------------------------------------------
|
||||
class DeadCodeAnalyzer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
struct DeadFunction
|
||||
{
|
||||
FunctionScanner::FunctionInfo info;
|
||||
QString reason;
|
||||
};
|
||||
|
||||
explicit DeadCodeAnalyzer(QObject *parent = nullptr);
|
||||
|
||||
// excludeDirs: Verzeichnisnamen die komplett übersprungen werden
|
||||
// z.B. {"vendor", "lib", "node_modules"}
|
||||
QList<DeadFunction> analyze(const QString &projectRoot,
|
||||
const QStringList &extensions = {"*.php"},
|
||||
const QStringList &excludeDirs = {}) const;
|
||||
|
||||
signals:
|
||||
// Fortschritt während der Analyse (läuft im Thread)
|
||||
void progressUpdate(int filesScanned, int filesTotal,
|
||||
const QString ¤tFile) const;
|
||||
|
||||
private:
|
||||
FunctionScanner *m_scanner = nullptr;
|
||||
};
|
||||
Reference in New Issue
Block a user