Skip to content

Commit

Permalink
A few more NOSONAR suppressions in PyImath
Browse files Browse the repository at this point in the history
SonarCloud reports expressions such as "self == self" as bugs, but
this construct is used in the boost::python template instantiations.

Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed Sep 18, 2019
1 parent 7995539 commit eae0e33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions PyIlmBase/PyImath/PyImathFixedMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,9 @@ template <class T>
static void add_mod_math_functions(boost::python::class_<FixedMatrix<T> > &c) {
using namespace boost::python;
c
.def(self % self)
.def(self % self) // NOSONAR - suppress SonarCloud bug report.
.def(self % other<T>())
.def(self %= self)
.def(self %= self) // NOSONAR - suppress SonarCloud bug report.
.def(self %= other<T>())
;
}
Expand All @@ -513,13 +513,13 @@ template <class T>
static void add_shift_math_functions(boost::python::class_<FixedMatrix<T> > &c) {
using namespace boost::python;
c
.def(self << self)
.def(self << self) // NOSONAR - suppress SonarCloud bug report.
.def(self << other<T>())
.def(self <<= self)
.def(self <<= self) // NOSONAR - suppress SonarCloud bug report.
.def(self <<= other<T>())
.def(self >> self)
.def(self >> self) // NOSONAR - suppress SonarCloud bug report.
.def(self >> other<T>())
.def(self >>= self)
.def(self >>= self) // NOSONAR - suppress SonarCloud bug report.
.def(self >>= other<T>())
;
}
Expand All @@ -530,15 +530,15 @@ static void add_bitwise_math_functions(boost::python::class_<FixedMatrix<T> > &c
c
.def(self & self)
.def(self & other<T>())
.def(self &= self)
.def(self &= self) // NOSONAR - suppress SonarCloud bug report.
.def(self &= other<T>())
.def(self | self)
.def(self | other<T>())
.def(self |= self)
.def(self |= self) // NOSONAR - suppress SonarCloud bug report.
.def(self |= other<T>())
.def(self ^ self)
.def(self ^ other<T>())
.def(self ^= self)
.def(self ^= self) // NOSONAR - suppress SonarCloud bug report.
.def(self ^= other<T>())
;
}
Expand Down
6 changes: 3 additions & 3 deletions PyIlmBase/PyImath/PyImathVec2Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ register_Vec2()
.def("__mul__", &Vec2_mulM33<T, double>)
.def("__imul__", &Vec2_imulM33<T, float>, return_internal_reference<>())
.def("__imul__", &Vec2_imulM33<T, double>, return_internal_reference<>())
.def(self / self)
.def(self / self) // NOSONAR - suppress SonarCloud bug report.
.def("__div__", &Vec2_div<T,int>)
.def("__div__", &Vec2_div<T,float>)
.def("__div__", &Vec2_div<T,double>)
Expand All @@ -1027,8 +1027,8 @@ register_Vec2()
.def("__itruediv__", &Vec2_idivObj<T>,return_internal_reference<>())
.def("__xor__", &Vec2_dot<T>)
.def("__mod__", &Vec2_cross<T>)
.def(self == self)
.def(self != self)
.def(self == self) // NOSONAR - suppress SonarCloud bug report.
.def(self != self) // NOSONAR - suppress SonarCloud bug report.
.def("__eq__", &equal<T,tuple>)
.def("__ne__", &notequal<T,tuple>)
.def("__add__", &Vec2_add<T>)
Expand Down

0 comments on commit eae0e33

Please sign in to comment.