Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar: also ignore S5271 for the examples in C++
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 10 May 2020 20:17:19 +0000 (22:17 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 10 May 2020 20:19:59 +0000 (22:19 +0200)
Plus fix some other warnings reported by sonar.

sonar-project.properties
src/kernel/activity/ActivityImpl.hpp
teshsuite/s4u/actor-suspend/actor-suspend.cpp

index 7033c24..66edad6 100644 (file)
@@ -14,7 +14,7 @@ sonar.sources=src,examples,include,teshsuite
 
 
 # Disable some rules on some files
-sonar.issue.ignore.multicriteria=j1,j2,j3,j4,j5,jni1,jni2,c1,c2a,c2b,c3,c5a,c5b,c6a,c6b,c7,c8a,c8b,c9,c10a,c10b,c10c,cex1a,cex1b,cex2,cex3,cex4,f1,p1,s1,s2,s3,s4,s5
+sonar.issue.ignore.multicriteria=j1,j2,j3,j4,j5,jni1,jni2,c1,c2a,c2b,c3,c5a,c5b,c6a,c6b,c7,c8a,c8b,c9,c10a,c10b,c10c,cex1a,cex1b,cex2a,cex2b,cex3,cex4,f1,p1,s1,s2,s3,s4,s5
 
 # The Object.finalize() method should not be overridden
 # But we need to clean the native memory with JNI
@@ -119,8 +119,10 @@ sonar.issue.ignore.multicriteria.cex1b.resourceKey=examples/**/*.hpp
 
 # Functions which do not return should be declared as "noreturn"
 # But examples are intended to remain small and simple
-sonar.issue.ignore.multicriteria.cex2.ruleKey=c:S5271
-sonar.issue.ignore.multicriteria.cex2.resourceKey=examples/**/*.c
+sonar.issue.ignore.multicriteria.cex2a.ruleKey=c:S5271
+sonar.issue.ignore.multicriteria.cex2a.resourceKey=examples/**/*.c
+sonar.issue.ignore.multicriteria.cex2b.ruleKey=cpp:S5271
+sonar.issue.ignore.multicriteria.cex2b.resourceKey=examples/**/*.cpp
 
 # Unused function parameters should be removed, but not in examples
 sonar.issue.ignore.multicriteria.cex3.ruleKey=c:S1172
index 7cf2c0b..fcda330 100644 (file)
@@ -89,7 +89,7 @@ private:
   std::string tracing_category_ = "";
 
 public:
-  AnyActivityImpl& set_name(const std::string& name)
+  AnyActivityImpl& set_name(const std::string& name) /* Hides the function in the ancestor class */
   {
     ActivityImpl::set_name(name);
     return static_cast<AnyActivityImpl&>(*this);
index a75cc86..7db5045 100644 (file)
@@ -33,10 +33,6 @@ class Suspender {
 public:
   void operator()()
   {
-
-    // If we sleep a bit here, this MWE works because the suspender is not trying to suspend someone executed later in
-    // the same scheduling round simgrid::s4u::this_actor::sleep_for(0.01);
-
     XBT_INFO("Suspend the receiver...");
     receiver->suspend();
     XBT_INFO("Resume the receiver...");