Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid implicit conversion #335

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

TobiasDuswald
Copy link
Contributor

@TobiasDuswald TobiasDuswald commented May 22, 2023

Addressing the following issues flagged by Sonar: https://sonarcloud.io/project/issues?resolved=false&rules=cpp%3AS1709&types=CODE_SMELL&id=BioDynaMo_biodynamo

Background:

  • MISRA C++:2008, 12-1-3 - All constructors that are callable with a single argument of fundamental type shall be declared explicit.
  • C++ Core Guidelines C.46 - By default, declare single-argument constructors explicit
  • C++ Core Guidelines C.164 - Avoid implicit conversion operators

Significant changes:

  1. AgentUid to uint64_t is now explicit (requires casting)
  2. LineGraph constructor now takes a pointer to bdm::experimental::Style and not Root::TStyle (conversion in the constructor)
  3. AgentPtr to bool kept for convenience.

(1.) should be discussed.

@sonarcloud
Copy link

sonarcloud bot commented May 22, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

42.9% 42.9% Coverage
0.0% 0.0% Duplication

@TobiasDuswald TobiasDuswald added api-change Changes affecting the API bdm-core Changes in BDM core ready-for-review PR is ready for review maintenance labels May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes affecting the API bdm-core Changes in BDM core maintenance ready-for-review PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant