Cppcheck
Functions | Variables
cppcheck.cpp File Reference
#include "cppcheck.h"
#include "addoninfo.h"
#include "check.h"
#include "checkunusedfunctions.h"
#include "clangimport.h"
#include "color.h"
#include "ctu.h"
#include "errortypes.h"
#include "filesettings.h"
#include "library.h"
#include "path.h"
#include "platform.h"
#include "preprocessor.h"
#include "standards.h"
#include "suppressions.h"
#include "timer.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"
#include "valueflow.h"
#include "version.h"
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <ctime>
#include <exception>
#include <fstream>
#include <iostream>
#include <new>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include "json.h"
#include <simplecpp.h>
#include "xml.h"

Go to the source code of this file.

Functions

static std::string cmdFileName (std::string f)
 
static std::vector< std::string > split (const std::string &str, const std::string &sep=" ")
 
static std::string getDumpFileName (const Settings &settings, const std::string &filename)
 
static std::string getCtuInfoFileName (const std::string &dumpFile)
 
static void createDumpFile (const Settings &settings, const std::string &filename, std::ofstream &fdump, std::string &dumpFile)
 
static std::string detectPython (const CppCheck::ExecuteCmdFn &executeCommand)
 
static std::vector< picojson::value > executeAddon (const AddonInfo &addonInfo, const std::string &defaultPythonExe, const std::string &file, const std::string &premiumArgs, const CppCheck::ExecuteCmdFn &executeCommand)
 
static std::string getDefinesFlags (const std::string &semicolonSeparatedString)
 
static bool reportClangErrors (std::istream &is, const std::function< void(const ErrorMessage &)> &reportErr, std::vector< ErrorMessage > &warnings)
 
static simplecpp::TokenList createTokenList (const std::string &filename, std::vector< std::string > &files, simplecpp::OutputList *outputList, std::istream *fileStream)
 

Variables

static constexpr char Version [] = CPPCHECK_VERSION_STRING
 
static constexpr char ExtraVersion [] = ""
 
static constexpr char FILELIST [] = "cppcheck-addon-ctu-file-list"
 
static TimerResults s_timerResults
 
static const CWE CWE398 (398U)
 

Function Documentation

◆ cmdFileName()

static std::string cmdFileName ( std::string  f)
static

Definition at line 105 of file cppcheck.cpp.

References Path::toNativeSeparators().

Referenced by executeAddon().

◆ createDumpFile()

static void createDumpFile ( const Settings settings,
const std::string &  filename,
std::ofstream &  fdump,
std::string &  dumpFile 
)
static

◆ createTokenList()

static simplecpp::TokenList createTokenList ( const std::string &  filename,
std::vector< std::string > &  files,
simplecpp::OutputList *  outputList,
std::istream *  fileStream 
)
static

Definition at line 593 of file cppcheck.cpp.

Referenced by CppCheck::checkFile().

◆ detectPython()

static std::string detectPython ( const CppCheck::ExecuteCmdFn executeCommand)
static

Definition at line 207 of file cppcheck.cpp.

References split(), and startsWith().

Referenced by executeAddon().

◆ executeAddon()

static std::vector<picojson::value> executeAddon ( const AddonInfo addonInfo,
const std::string &  defaultPythonExe,
const std::string &  file,
const std::string &  premiumArgs,
const CppCheck::ExecuteCmdFn executeCommand 
)
static

◆ getCtuInfoFileName()

static std::string getCtuInfoFileName ( const std::string &  dumpFile)
static

◆ getDefinesFlags()

static std::string getDefinesFlags ( const std::string &  semicolonSeparatedString)
static

Definition at line 325 of file cppcheck.cpp.

References split().

Referenced by CppCheck::analyseClangTidy(), and CppCheck::checkClang().

◆ getDumpFileName()

static std::string getDumpFileName ( const Settings settings,
const std::string &  filename 
)
static

◆ reportClangErrors()

static bool reportClangErrors ( std::istream &  is,
const std::function< void(const ErrorMessage &)> &  reportErr,
std::vector< ErrorMessage > &  warnings 
)
static

Definition at line 364 of file cppcheck.cpp.

References error, normal, and Path::toNativeSeparators().

Referenced by CppCheck::checkClang().

◆ split()

static std::vector<std::string> split ( const std::string &  str,
const std::string &  sep = " " 
)
static

Variable Documentation

◆ CWE398

const CWE CWE398(398U) ( 398U  )
static

◆ ExtraVersion

constexpr char ExtraVersion[] = ""
staticconstexpr

Definition at line 79 of file cppcheck.cpp.

Referenced by CppCheck::extraVersion().

◆ FILELIST

constexpr char FILELIST[] = "cppcheck-addon-ctu-file-list"
staticconstexpr

Definition at line 81 of file cppcheck.cpp.

Referenced by executeAddon(), and CppCheck::executeAddons().

◆ s_timerResults

TimerResults s_timerResults
static

◆ Version

constexpr char Version[] = CPPCHECK_VERSION_STRING
staticconstexpr

Definition at line 78 of file cppcheck.cpp.

Referenced by CppCheck::version().