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: https://sonarcloud.io/project/issues?pullRequest=258&issues=AYS_FUe6WkHWDnFRHIxw&open=AYS_FUe6WkHWDnFRHIxw&id=BioDynaMo_biodynamo

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

Thanks for your help!
Tobias

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.

Thanks,

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