Skip to content

Commit

Permalink
Address few more codacity issues
Browse files Browse the repository at this point in the history
Signed-off-by: Gautam Venkataramanan <gautam.chennai@gmail.com>
  • Loading branch information
gautvenk committed Aug 17, 2020
1 parent 3b20a6d commit 93da733
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
[Prometheus integration](docs/prometheus.md)

[Configuring and using drop logs](docs/drop_logs.md)

6 changes: 3 additions & 3 deletions agent-ovs/lib/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class OStreamLogSink : public LogSink {
* Constructor that accepts the output stream to write logs to.
* @param outStream The stream to send messages to.
*/
OStreamLogSink(std::ostream& outStream) : out(&outStream) {
explicit OStreamLogSink(std::ostream& outStream) : out(&outStream) {
static const boost::posix_time::time_facet facet;
out->imbue(std::locale(out->getloc(), &facet));
}
Expand All @@ -53,7 +53,7 @@ class OStreamLogSink : public LogSink {
* appended.
* @param fileName The filename to send log messages to.
*/
OStreamLogSink(const std::string& fileName) :
explicit OStreamLogSink(const std::string& fileName) :
fileStream(fileName.c_str(), std::ios_base::out | std::ios_base::app) {
if (!fileStream.good()) {
out = &std::cout;
Expand Down Expand Up @@ -105,7 +105,7 @@ const char * OStreamLogSink::LEVEL_STR_FATAL = "fatal";
*/
class SyslogLogSink : public LogSink {
public:
SyslogLogSink(const std::string& name) : syslog_name(name) {
explicit SyslogLogSink(const std::string& name) : syslog_name(name) {
openlog(syslog_name.c_str(), LOG_CONS | LOG_PID, LOG_DAEMON);
}
~SyslogLogSink() {
Expand Down
2 changes: 1 addition & 1 deletion agent-ovs/ovs/PolicyStatsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ generatePolicyStatsObjects(PolicyCounterMap_t *newCountersMap1,
if (!newCountersMap1->size() && newCountersMap2) {
for (PolicyCounterMap_t:: iterator itr = newCountersMap2->begin();
itr != newCountersMap2->end();
itr++) {
++itr) {
const PolicyFlowMatchKey_t& flowKey = itr->first;
FlowStats_t& outCounters = itr->second;
FlowStats_t inCounters;
Expand Down
2 changes: 1 addition & 1 deletion agent-ovs/ovs/integration-test/flowmod_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace opflexagent;

class BlockingFlowReader {
public:
BlockingFlowReader(SwitchConnection *c) {
explicit BlockingFlowReader(SwitchConnection *c) {
conn = c;
reader.installListenersForConnection(conn);
cb = boost::bind(&BlockingFlowReader::gotFlow, this, _1, _2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class IStreamWrapper {
public:
typedef char Ch;

IStreamWrapper(std::istream& is)
explicit IStreamWrapper(std::istream& is)
: is_(is)
{}

Expand Down
4 changes: 2 additions & 2 deletions libopflex/include/opflex/yajr/rpc/rpc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class GeneratorFromValue {
* Generate JSON from value
* @param v rapidjson value
*/
GeneratorFromValue(rapidjson::Value const & v) : v_(v) {}
explicit GeneratorFromValue(rapidjson::Value const & v) : v_(v) {}

/** () operator */
virtual bool operator()(yajr::rpc::SendHandler& h) {
Expand Down Expand Up @@ -139,7 +139,7 @@ class RemoteIdentifier : virtual public Identifier {
* Construct a remote identitier
* @param id JSON ID
*/
RemoteIdentifier(rapidjson::Value const & id) : id_(id) {}
explicit RemoteIdentifier(rapidjson::Value const & id) : id_(id) {}

/**
* Emit the identifier
Expand Down
2 changes: 1 addition & 1 deletion libopflex/include/opflex/yajr/transport/engine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class TransportEngine : public Transport {
/**
* Construct a transport engine
*/
TransportEngine(E *);
explicit TransportEngine(E *);
~TransportEngine();
};

Expand Down
2 changes: 1 addition & 1 deletion libopflex/modb/URIBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class URIBuilder::URIBuilderImpl {
uri_stream << '/';
}

URIBuilderImpl(const URI& uri) {
explicit URIBuilderImpl(const URI& uri) {
uri_stream.fill('0');
uri_stream << uri.toString();
}
Expand Down

0 comments on commit 93da733

Please sign in to comment.