mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
cppcheck: make static analysis more pedantic
This commit is contained in:
@@ -57,3 +57,14 @@ useStlAlgorithm:test/regression/regression.cc:493
|
||||
useStlAlgorithm:test/unit/unit.cc:174
|
||||
useStlAlgorithm:test/unit/unit.cc:209
|
||||
variableScope:src/operators/verify_cpf.cc:45
|
||||
unusedFunction
|
||||
funcArgNamesDifferent
|
||||
preprocessorErrorDirective
|
||||
useStlAlgorithm
|
||||
functionStatic:test/regression/regression_test.h:36
|
||||
missingInclude
|
||||
toomanyconfigs
|
||||
functionStatic:src/unique_id.h:49
|
||||
functionStatic:src/unique_id.h:50
|
||||
functionConst:src/utils/geo_lookup.h:49
|
||||
functionStatic:headers/modsecurity/transaction.h:374
|
@@ -36,13 +36,13 @@ void CustomDebugLog::write(int level, const std::string &id,
|
||||
m_log << msgf << std::endl;
|
||||
}
|
||||
|
||||
bool CustomDebugLog::contains(const std::string& pattern) {
|
||||
bool const CustomDebugLog::contains(const std::string& pattern) const {
|
||||
modsecurity::Utils::Regex re(pattern);
|
||||
std::string s = m_log.str();
|
||||
return modsecurity::Utils::regex_search(s, re);
|
||||
}
|
||||
|
||||
std::string CustomDebugLog::log_messages() {
|
||||
std::string const CustomDebugLog::log_messages() const {
|
||||
return m_log.str();
|
||||
}
|
||||
|
||||
|
@@ -31,8 +31,8 @@ class CustomDebugLog : public modsecurity::debug_log::DebugLog {
|
||||
void write(int level, const std::string& message) override;
|
||||
void write(int level, const std::string &id,
|
||||
const std::string &uri, const std::string &msg) override;
|
||||
bool contains(const std::string& pattern);
|
||||
std::string log_messages();
|
||||
bool const contains(const std::string& pattern) const;
|
||||
std::string const log_messages() const;
|
||||
std::string error_log_messages();
|
||||
int getDebugLogLevel() override;
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
namespace modsecurity_test {
|
||||
|
||||
std::string RegressionTest::print() {
|
||||
const std::string RegressionTest::print() {
|
||||
std::stringstream i;
|
||||
|
||||
#if 0
|
||||
|
@@ -33,7 +33,7 @@ class RegressionTest {
|
||||
public:
|
||||
static RegressionTest *from_yajl_node(const yajl_val &);
|
||||
|
||||
std::string print();
|
||||
const std::string print();
|
||||
std::string filename;
|
||||
std::string name;
|
||||
std::string title;
|
||||
|
@@ -119,7 +119,7 @@ std::string UnitTest::print() {
|
||||
}
|
||||
|
||||
|
||||
UnitTest *UnitTest::from_yajl_node(yajl_val &node) {
|
||||
UnitTest *UnitTest::from_yajl_node(const yajl_val &node) {
|
||||
size_t num_tests = node->u.object.len;
|
||||
UnitTest *u = new UnitTest();
|
||||
|
||||
|
@@ -27,7 +27,7 @@ namespace modsecurity_test {
|
||||
|
||||
class UnitTest {
|
||||
public:
|
||||
static UnitTest *from_yajl_node(yajl_val &);
|
||||
static UnitTest *from_yajl_node(const yajl_val &);
|
||||
|
||||
std::string print();
|
||||
|
||||
|
Reference in New Issue
Block a user