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

chore: fix more sonralcloud issues #4017

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

Conversation

asalzburger
Copy link
Contributor

@asalzburger asalzburger commented Jan 10, 2025

Some more sonar cloud issue fixes from Core/EventData mainly.

--- END COMMIT MESSAGE ---

Any further description goes here, @-mentions are ok here!

  • Use a conventional commits prefix: quick summary
    • We mostly use feat, fix, refactor, docs, chore and build types.
  • A milestone will be assigned by one of the maintainers

Summary by CodeRabbit

  • Code Quality

    • Added namespace qualifications for improved code clarity.
    • Enhanced type safety by adding explicit to various constructors.
    • Added noexcept specifiers to move constructors and assignment operators.
  • Refactor

    • Updated constructor signatures across multiple classes to prevent implicit conversions.
    • Improved type safety in class constructors and type declarations.

@asalzburger asalzburger added this to the next milestone Jan 10, 2025
Copy link

coderabbitai bot commented Jan 10, 2025

Walkthrough

The pull request introduces namespace qualifications and explicit constructors across multiple header files in the Acts library. These changes enhance type safety by preventing implicit conversions and clarifying type origins. The modifications span various classes and structs, primarily adding explicit to constructors and noexcept to move operations, with no fundamental changes to the underlying logic or functionality.

Changes

File Change Summary
Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp Added Acts:: namespace qualification for types in TrackAlignmentState struct
Core/include/Acts/Detector/* Added explicit to constructors in ObjectStore, IndexedRootVolumeFinderBuilder, SurfacesHolder, Portal
Core/include/Acts/EventData/* Added noexcept to move constructors and move assignment operators in multiple classes; added explicit to various constructors

Suggested Labels

automerge, Changes Performance

Suggested Reviewers

Poem

Constructors dance with grace so light,
Explicit now, no hidden might
Namespace clear, no shadows cast
Type safety grows, performance fast! 🚀
Yoda's code, a wisdom bright 🌟

Walkthrough (Yoda Style)

Hmm, changes subtle but powerful, they are! Namespace clarity, we seek. Constructors explicit, they become. Move operations safe, they now stand. Prevent implicit conversions, we must! A path to cleaner code, this is.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c522a5e and e7fe536.

📒 Files selected for processing (1)
  • Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: merge-sentinel

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added Component - Core Affects the Core module Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins Event Data Model Seeding labels Jan 10, 2025
@github-actions github-actions bot removed Component - Examples Affects the Examples module Component - Plugins Affects one or more Plugins Seeding labels Jan 10, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
Core/include/Acts/EventData/GenericFreeTrackParameters.hpp (1)

133-133: Strong with the force, these changes are!

Noexcept move operations, correctly added they are. Member types, support noexcept moves they do.

Hmm, future improvement sense I do. When C++20 arrives, [[no_unique_address]] for ParticleHypothesis member, use you should. TODO comment about this, already exists it does.

Also applies to: 137-138

Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp (1)

38-67: Clear namespace origins, now we see! Hmmmm.

Qualified with Acts:: namespace, all types now are. Clarity and wisdom, this brings to the code. Prevent confusion in the future, it will.

Consider using namespace alias to reduce verbosity, you might:

namespace Acts::detail {
  using Matrix = Acts::ActsDynamicMatrix;
  using Vector = Acts::ActsDynamicVector;
  // ... rest of the code
}

Also applies to: 105-107, 172-185, 205-242, 278-282

Core/include/Acts/EventData/VectorMultiTrajectory.hpp (1)

572-575: Approve these changes, I do! Hmmmm.

Made explicit the constructors are, preventing accidental conversions they do. A path to safer code, this is.

Consider similar treatment for other constructors in the codebase, you should. A consistent approach to type safety, it brings.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe95173 and 6906aac.

📒 Files selected for processing (16)
  • Alignment/include/ActsAlignment/Kernel/detail/AlignmentEngine.hpp (7 hunks)
  • Core/include/Acts/Detector/DetectorVolume.hpp (1 hunks)
  • Core/include/Acts/Detector/IndexedRootVolumeFinderBuilder.hpp (1 hunks)
  • Core/include/Acts/Detector/LayerStructureBuilder.hpp (1 hunks)
  • Core/include/Acts/Detector/Portal.hpp (1 hunks)
  • Core/include/Acts/EventData/GenericBoundTrackParameters.hpp (1 hunks)
  • Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp (1 hunks)
  • Core/include/Acts/EventData/GenericFreeTrackParameters.hpp (1 hunks)
  • Core/include/Acts/EventData/MultiTrajectory.hpp (1 hunks)
  • Core/include/Acts/EventData/ProxyAccessor.hpp (1 hunks)
  • Core/include/Acts/EventData/SourceLink.hpp (1 hunks)
  • Core/include/Acts/EventData/TrackStateProxy.hpp (1 hunks)
  • Core/include/Acts/EventData/VectorMultiTrajectory.hpp (1 hunks)
  • Core/include/Acts/EventData/VectorTrackContainer.hpp (1 hunks)
  • Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp (1 hunks)
  • Tests/UnitTests/Core/EventData/MultiTrajectoryTests.cpp (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Core/include/Acts/EventData/GenericBoundTrackParameters.hpp
⏰ Context from checks skipped due to timeout of 90000ms (14)
  • GitHub Check: CI Bridge / lcg_105: [alma9, gcc13]
  • GitHub Check: CI Bridge / linux_ubuntu_2204_clang
  • GitHub Check: CI Bridge / linux_ubuntu_2204
  • GitHub Check: CI Bridge / build_linux_ubuntu
  • GitHub Check: CI Bridge / build_exatrkx
  • GitHub Check: CI Bridge / build_exatrkx_cpu
  • GitHub Check: CI Bridge / clang_tidy
  • GitHub Check: merge-sentinel
  • GitHub Check: missing_includes
  • GitHub Check: linux_ubuntu
  • GitHub Check: macos
  • GitHub Check: linux_ubuntu_extra (ubuntu2204_clang, 20)
  • GitHub Check: linux_ubuntu_extra (ubuntu2204, 20)
  • GitHub Check: build_debug
🔇 Additional comments (12)
Core/include/Acts/EventData/SourceLink.hpp (1)

32-32: Wise changes these are, approve them I do!

Added noexcept to move operations, improve exception safety guarantees it does. Strong exception guarantee, the force is with this code.

Also applies to: 34-34

Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp (1)

94-95: Consistent with the force, these changes are!

Noexcept move operations, aligned with base class they are. Strong exception safety, inherited from GenericBoundTrackParameters it is.

Also applies to: 100-100

Core/include/Acts/Detector/IndexedRootVolumeFinderBuilder.hpp (1)

29-30: Wise change, this is!

Prevent accidental conversions from vector to IndexedRootVolumeFinderBuilder, the explicit keyword does. Strong in the ways of type safety, you have become.

Core/include/Acts/EventData/ProxyAccessor.hpp (1)

73-73: Hmmmm... Good changes these are!

Prevent implicit conversions from HashedString and std::string, these modifications do. Safe from the dark side of type conversions, your code now is.

Also applies to: 77-77

Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp (1)

75-76: Strong with the Force, this change is!

Prevent accidental transformations from FreeToBoundCorrection, the explicit keyword does. Clear intentions in your code, you now have.

Core/include/Acts/Detector/LayerStructureBuilder.hpp (1)

61-61: Mmmmm... A path to clarity, you have found!

Prevent unintended surface vector conversions, this explicit constructor does. Protected from the dark side of implicit conversions, your SurfacesHolder now is.

Core/include/Acts/Detector/Portal.hpp (1)

50-50: Wise addition of explicit keyword, this is!

Prevent accidental conversions from shared_ptr to Portal, this change does. A path to safer code, it is.

Tests/UnitTests/Core/EventData/MultiTrajectoryTests.cpp (1)

95-95: Changed initialization style, you have. Good, this is!

From copy initialization to direct initialization, the path leads. With explicit constructors, this aligns better.

Core/include/Acts/EventData/VectorTrackContainer.hpp (1)

285-293: Strong with type safety, these changes are!

Two constructors, explicit now they become. Prevent accidental conversions, they do, while maintaining both copy and move powers.

Core/include/Acts/Detector/DetectorVolume.hpp (1)

87-87: Wise decision this is, approve it I do!

Explicit constructor prevents accidental conversions from std::vector to ObjectStore. Strong in the ways of type safety, this change is.

Core/include/Acts/EventData/MultiTrajectory.hpp (1)

111-111: Approve this change, I must!

Made explicit the constructor is, preventing accidental conversions from ProxyType to TrackStateRange. In harmony with the Force of type safety, this change is.

Core/include/Acts/EventData/TrackStateProxy.hpp (1)

45-45: Strong with type safety, this change is. Approve it, I do!

Made explicit the constructor is, preventing the dark side of implicit pointer conversions. A wise path to safer code, this follows.

Copy link

github-actions bot commented Jan 10, 2025

📊: Physics performance monitoring for bcdb966

Full contents

physmon summary

Copy link

sonarqubecloud bot commented Jan 10, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant