19#ifndef CODEANALYZER_HPP
20#define CODEANALYZER_HPP
26#include "../../kernel/core/symdef.hpp"
This class analyzes the code handled by the editor by accessing it with friends rights.
int calculateCyclomaticComplexity(int startline, int endline)
Calculates the cyclomatic complexity between both lines.
std::string m_sCurrentLine
bool m_hasProcedureDefinition
AnnotationCount analyseNumbers()
Analyses occurences of numerical literals.
AnnotationCount analyseFunctions(bool isContinuedLine)
Analyses calls to standard functions.
int calculateLinesOfCode(int startline, int endline)
Calculates the lines of code between both lines.
const double MINCOMMENTDENSITY
AnnotationCount analysePreDefs()
Analyses occurences of special predefined variables.
std::vector< std::pair< std::string, int > > m_vLocalVariables
std::vector< std::string > m_STRING_METHODS
const int MAXCOMPLEXITYWARN
std::string m_currentMode
void run()
Starts the code analysis. Requires a pointer to the editor and to the options.
AnnotationCount analyseCommands()
Analyses commands in the code.
AnnotationCount analyseOperators()
Analyses occurences of operators.
bool containsAssignment(const std::string &sCurrentLine)
Checks for assignments.
const int MAXCOMPLEXITYNOTIFY
const double MAXCOMMENTDENSITY
std::vector< std::string > m_STRING_FUNCS
std::vector< std::string > m_MATOP_FUNCS
static void changeVariableType(std::string &sVarName, char type)
Change the variable's type to the passed type.
AnnotationCount analyseProcedures()
Analyses calls to procedures.
AnnotationCount addToAnnotation(const std::string &sMessage, int nStyle)
Adds the passed sMessage with the style to the internal cache.
std::vector< std::string > m_DRAW_FUNCS
CodeAnalyzer(NumeReEditor *parent, Options *opts)
AnnotationCount analyseIdentifiers()
Analyses occurences of identifiers.
std::string highlightFoundOccurence(const std::string &sElement, int nPos, int nLength)
Highlights the occurence in the editor.
int countNumberOfComments(int startline, int endline)
Counts the number of comment lines between both lines.
static char getVariableType(const std::string &sVarName)
Returns the leading character, which indicates the type of this variable or a null character,...
The class of the editor window.
This class implements an interface of the internal Settings object adapted to be usable from the GUI.
This class handles the file-static constants, which are more or less macros similar to #define in C/C...
Stores the number of annotations for displaying a summary.
AnnotationCount & operator+=(const AnnotationCount &annotcount)