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

Add transitive reduction algorithm #304

Merged
merged 3 commits into from
May 25, 2023

Conversation

nrkramer
Copy link
Collaborator

@nrkramer nrkramer commented May 24, 2023

A good pull request has the following information:

@nrkramer nrkramer requested a review from ZigRazor May 24, 2023 06:26
@nrkramer nrkramer self-assigned this May 24, 2023
@github-actions github-actions bot added core something about core test Something about test labels May 24, 2023
@ghost
Copy link

ghost commented May 24, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

include/Graph/Graph.hpp Show resolved Hide resolved
include/Graph/Graph.hpp Show resolved Hide resolved
include/Graph/Graph.hpp Show resolved Hide resolved
include/Graph/Graph.hpp Show resolved Hide resolved
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Cppcheck (reported by Codacy) found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Owner

@ZigRazor ZigRazor left a comment

Choose a reason for hiding this comment

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

Do you can check if is possible to eliminate at least the "violations" reported by cppcheck?

@ZigRazor ZigRazor added the development Development of new Functionalities label May 24, 2023
@ZigRazor ZigRazor added this to the Algorithm Implementation milestone May 24, 2023
@ZigRazor ZigRazor linked an issue May 24, 2023 that may be closed by this pull request
@nrkramer
Copy link
Collaborator Author

Do you can check if is possible to eliminate at least the "violations" reported by cppcheck?

I've fixed a few of the "violations". Some of them seem intended for C, such as MISRA 17.8, as reference parameter modification is bread-and-butter in C++ (in C++, programmers use const to denote that the reference should not be modified in the function body).

Some of the other violations, such as MISRA 15.5, are necessary as optimizations. Early return from function is common practice to speed up function calls, and refractoring the function to support leaving loops quickly would result in code that is difficult to understand.

I've dismissed the violations on code in which this PR is not concerned, as it is irrelevant to the PR.

@nrkramer nrkramer requested a review from ZigRazor May 25, 2023 05:22
@@ -2999,7 +3074,7 @@

// Since the matrix represents the adjacency matrix, it must be square
if (n_rows != n_cols) {
return -1;
return -1;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule

MISRA 15.5 rule
* satisfied.
*
*/
virtual const Graph<T> transitiveReduction() const;

Check warning

Code scanning / Cppcheck (reported by Codacy)

misra violation 802 with no text in the supplied rule-texts-file

misra violation 802 with no text in the supplied rule-texts-file
@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #304 (71011e3) into master (430ce48) will decrease coverage by 0.17%.
The diff coverage is 97.37%.

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
- Coverage   97.71%   97.55%   -0.17%     
==========================================
  Files          51       53       +2     
  Lines        7189     7449     +260     
==========================================
+ Hits         7025     7267     +242     
- Misses        164      182      +18     
Flag Coverage Δ
unittests 97.55% <97.37%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/Graph/Graph.hpp 96.63% <93.33%> (-0.28%) ⬇️
test/MTXTest.cpp 100.00% <100.00%> (ø)
test/TransitiveReductionTest.cpp 100.00% <100.00%> (ø)

... and 4 files with indirect coverage changes

Copy link
Owner

@ZigRazor ZigRazor left a comment

Choose a reason for hiding this comment

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

Good Job!

@ZigRazor ZigRazor merged commit 09ec417 into ZigRazor:master May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core something about core development Development of new Functionalities test Something about test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add algorithm to compute the transitive reduction
2 participants