Detects License Header as commented out code

Dear Developers,

first of all thanks for the great tool that you provide to the open-source community, it has been tremendously helpful for our project already!

In our C++ code base, all header and source files start with the following statement:

// -----------------------------------------------------------------------------
// Copyright (C) 2021 CERN & University of Surrey for the benefit of the
// BioDynaMo collaboration. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// See the LICENSE file distributed with this work for details.
// See the NOTICE file distributed with this work for additional information
// regarding copyright ownership.
// -----------------------------------------------------------------------------

When we send our compiled project to SonarCloud, the analyzer flags “Remove Commented out code” in this section of the code. See for instance here:

How do I best handle all these false positives or are we doing something wrong that this gets detected?

Thanks for your help!

Hello @TobiasDuswald,

Thanks for the valuable feedback!

The commented-out code rule suffered from a lot of false-positive like the one you mentioned.

Recently we fully reimplemented the rule to be much smarter. The reported false-positive is fixed and should be available on SonarCloud in 2 weeks max.

Until then, I suggest marking the issues as false positives.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.