Skip to content

Code cleanup, especially casts, lambdas, data types, encapsulation#952

Merged
uweseimet merged 48 commits intodevelopfrom
feature_minor_code_cleanup
Nov 2, 2022
Merged

Code cleanup, especially casts, lambdas, data types, encapsulation#952
uweseimet merged 48 commits intodevelopfrom
feature_minor_code_cleanup

Conversation

@uweseimet
Copy link
Copy Markdown
Contributor

@uweseimet uweseimet commented Oct 30, 2022

Some cleanup stuff, mostly based on C++ best practices:

  • Use more static casts (recommended for C++)
  • Lambda syntax cleanup, in particular in the unit tests
  • Improved encapsulation of the controllers
  • Replaced pointers by references
  • Removed all remaining occurrences of the legacy DWORD and BYTE types, making os.h obsolete

Note that the bugs, security issues and code smells reported are not new code. They have been there before and are part of the bad code in cfilesystem.cpp.

@uweseimet uweseimet changed the title Feature minor code cleanup Minor code cleanup, especially casts and lambdas Oct 30, 2022
@uweseimet uweseimet marked this pull request as ready for review October 30, 2022 08:21
@uweseimet uweseimet changed the title Minor code cleanup, especially casts, lambdas and encapsulation Dode cleanup, especially casts, lambdas, data types, encapsulation Oct 31, 2022
@uweseimet uweseimet changed the title Dode cleanup, especially casts, lambdas, data types, encapsulation Code cleanup, especially casts, lambdas, data types, encapsulation Oct 31, 2022
@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 9 Code Smells

49.7% 49.7% Coverage
1.2% 1.2% Duplication

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Nov 1, 2022

@uweseimet Please note that branches with the "feature_" naming scheme are treated as long-lived branches in SonarCloud now. If you intended feature_minor_code_cleanup to be long-lived then that's fair game of course!

@uweseimet
Copy link
Copy Markdown
Contributor Author

@rdmark I thought this was only for branches starting with "release-" or "feature-", i.e. with a hyphen and not an underline character. But you are right, I missed that, and it is not intentional that my branches are long-lived branches.
Can you please delete my feature branches except for feature_minor_code_cleanup? That one can be deleted later, when the respective PR has been merged.

Branch names starting with "feature-" are not long-lived, are they?

@rdmark
Copy link
Copy Markdown
Member

rdmark commented Nov 1, 2022

@uweseimet Correct, branches that begin with "feature-" aren't treated as long-lived. But perhaps they should?

Long-lived branches pattern: (develop|feature_.*)

In my mind, long lived branches are those that make broad changes or implement a large chunk of new code, and will be iterated on over multiple weeks or longer. Hence, the need for continuous and persistent code quality scanning on them.

What do you think is a good branch naming scheme, that covers the various types of development that happen in this project?

@uweseimet
Copy link
Copy Markdown
Contributor Author

uweseimet commented Nov 1, 2022

@rdmark IMO for rascsi it is sufficient that only develop (besides master) is a long lived branch. For much more than a year (if I remember correctly) there has never been any feature branch that was alive for several weeks. Except for the branches marked as stale in github. I doubt that most of those are still useful. They have not been maintained/changed for ages, and it is unlikely that they can ever be merged into the current codebase after such a long time. Cleaning them up sounds like a good idea to me.
As far as I can tell I was not that wrong with my previous assumption: By default "branch-" and "release-" appear to be the standard default branches.

@akuker
Copy link
Copy Markdown
Member

akuker commented Nov 2, 2022

Good to go! Thanks @uweseimet !

@uweseimet
Copy link
Copy Markdown
Contributor Author

@akuker Thank you for reviewing!

@uweseimet uweseimet merged commit 621cc7d into develop Nov 2, 2022
@uweseimet uweseimet deleted the feature_minor_code_cleanup branch November 2, 2022 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants