-
Notifications
You must be signed in to change notification settings - Fork 21
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
semester_tasks #13
base: main
Are you sure you want to change the base?
semester_tasks #13
Conversation
(have some issues with packman algo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
for (const auto &neighbor : vertex->adjacent) { | ||
std::cout << neighbor->data << " "; | ||
} | ||
std::cout << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
std::cout << std::endl; | |
std::cout << '\n'; |
|
||
private: | ||
void FindingOrderStep(std::shared_ptr<Vertex<std::string>> target); | ||
DependencyGraph& dependencies_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member 'dependencies_' of type 'DependencyGraph &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
DependencyGraph& dependencies_;
^
task_01/src/test.cpp
Outdated
|
||
dg_1.AddDirEdge(0, 1); | ||
|
||
PackageManager packman_1(dg_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_1(dg_1); | |
PackageManager const packman_1(dg_1); |
task_01/src/test.cpp
Outdated
|
||
dg_2.AddDirEdge(0, 1); | ||
|
||
PackageManager packman_2(dg_2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_2' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_2(dg_2); | |
PackageManager const packman_2(dg_2); |
task_01/src/test.cpp
Outdated
dg_3.AddDirEdge(2, 3); | ||
dg_3.AddDirEdge(3, 4); | ||
|
||
PackageManager packman_3(dg_3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_3' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_3(dg_3); | |
PackageManager const packman_3(dg_3); |
task_01/src/test.cpp
Outdated
dg_4.AddDirEdge(4, 6); | ||
dg_4.AddDirEdge(5, 7); | ||
dg_4.AddDirEdge(6, 7); | ||
PackageManager packman_4(dg_4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_4' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_4(dg_4); | |
PackageManager const packman_4(dg_4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
for (const auto &neighbor : vertex->adjacent) { | ||
std::cout << neighbor->data << " "; | ||
} | ||
std::cout << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
std::cout << std::endl; | |
std::cout << '\n'; |
task_01/src/test.cpp
Outdated
|
||
dg_1.AddDirEdge(0, 1); | ||
|
||
PackageManager packman_1(dg_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_1(dg_1); | |
PackageManager const packman_1(dg_1); |
task_01/src/test.cpp
Outdated
|
||
dg_2.AddDirEdge(0, 1); | ||
|
||
PackageManager packman_2(dg_2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_2' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_2(dg_2); | |
PackageManager const packman_2(dg_2); |
task_01/src/test.cpp
Outdated
dg_3.AddDirEdge(2, 3); | ||
dg_3.AddDirEdge(3, 4); | ||
|
||
PackageManager packman_3(dg_3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_3' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_3(dg_3); | |
PackageManager const packman_3(dg_3); |
task_01/src/test.cpp
Outdated
dg_4.AddDirEdge(4, 6); | ||
dg_4.AddDirEdge(5, 7); | ||
dg_4.AddDirEdge(6, 7); | ||
PackageManager packman_4(dg_4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_4' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_4(dg_4); | |
PackageManager const packman_4(dg_4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
for (const auto &neighbor : vertex->adjacent) { | ||
std::cout << neighbor->data << " "; | ||
} | ||
std::cout << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
std::cout << std::endl; | |
std::cout << '\n'; |
lib/src/graph.hpp
Outdated
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<Vertex<T>>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<Vertex<T>>> vertices_;
^
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, reverse_order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:28:
- std::vector<bool> is_visited_;
- std::stack<std::string> reverse_order_;
+ std::vector<bool> is_visited_{};
+ std::stack<std::string> reverse_order_{};
|
||
private: | ||
void FindingOrderStep(std::shared_ptr<Vertex<std::string>> target); | ||
DependencyGraph& dependencies_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member 'dependencies_' of type 'DependencyGraph &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
DependencyGraph& dependencies_;
^
@@ -1,5 +1,111 @@ | |||
#include <gtest/gtest.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^
task_01/src/test.cpp
Outdated
dg_4.AddDirEdge(4, 6); | ||
dg_4.AddDirEdge(5, 7); | ||
dg_4.AddDirEdge(6, 7); | ||
PackageManager packman_4(dg_4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_4' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_4(dg_4); | |
PackageManager const packman_4(dg_4); |
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
std::vector<std::pair<int, int>> bridges; | ||
std::vector<int> cut_vertices; | ||
|
||
int time = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'time' of type 'int' can be declared 'const' [misc-const-correctness]
int time = 0; | |
int const time = 0; |
@@ -0,0 +1,16 @@ | |||
#pragma once | |||
|
|||
#include "graph.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'graph.hpp' file not found [clang-diagnostic-error]
#include "graph.hpp"
^
@@ -1,42 +1,115 @@ | |||
|
|||
#include <gtest/gtest.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 18. Check the log or trigger a new build to see more.
for (const auto &neighbor : vertex->adjacent) { | ||
std::cout << neighbor->data << " "; | ||
} | ||
std::cout << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
std::cout << std::endl; | |
std::cout << '\n'; |
lib/src/graph.hpp
Outdated
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<Vertex<T>>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<Vertex<T>>> vertices_;
^
task_01/src/main.cpp
Outdated
dg_1.AddDirEdge(3, 1); | ||
dg_1.AddDirEdge(0, 3); | ||
|
||
PackageManager packman_1(dg_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_1(dg_1); | |
PackageManager const packman_1(dg_1); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, reverse_order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:30:
- std::vector<bool> is_visited_;
- std::stack<std::string> reverse_order_;
+ std::vector<bool> is_visited_{};
+ std::stack<std::string> reverse_order_{};
|
||
private: | ||
void FindingOrderStep(std::shared_ptr<Vertex<std::string>> target); | ||
DependencyGraph& dependencies_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member 'dependencies_' of type 'DependencyGraph &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
DependencyGraph& dependencies_;
^
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
} | ||
|
||
TEST(NetworkTest, SimpleTriangleWithBridge) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, NoBridgesOrCutVertices) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, LineGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, EmptyGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 18. Check the log or trigger a new build to see more.
for (const auto &neighbor : vertex->adjacent) { | ||
std::cout << neighbor->data << " "; | ||
} | ||
std::cout << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
std::cout << std::endl; | |
std::cout << '\n'; |
lib/src/graph.hpp
Outdated
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<Vertex<T>>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<Vertex<T>>> vertices_;
^
task_01/src/main.cpp
Outdated
dg_1.AddDirEdge(3, 1); | ||
dg_1.AddDirEdge(0, 3); | ||
|
||
PackageManager packman_1(dg_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_1(dg_1); | |
PackageManager const packman_1(dg_1); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, reverse_order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:30:
- std::vector<bool> is_visited_;
- std::stack<std::string> reverse_order_;
+ std::vector<bool> is_visited_{};
+ std::stack<std::string> reverse_order_{};
|
||
private: | ||
void FindingOrderStep(std::shared_ptr<Vertex<std::string>> target); | ||
DependencyGraph& dependencies_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member 'dependencies_' of type 'DependencyGraph &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
DependencyGraph& dependencies_;
^
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
} | ||
|
||
TEST(NetworkTest, SimpleTriangleWithBridge) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, NoBridgesOrCutVertices) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, LineGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, EmptyGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 18. Check the log or trigger a new build to see more.
for (const auto &neighbor : vertex->adjacent) { | ||
std::cout << neighbor->data << " "; | ||
} | ||
std::cout << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
std::cout << std::endl; | |
std::cout << '\n'; |
lib/src/graph.hpp
Outdated
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<Vertex<T>>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<Vertex<T>>> vertices_;
^
task_01/src/main.cpp
Outdated
dg_1.AddDirEdge(3, 1); | ||
dg_1.AddDirEdge(0, 3); | ||
|
||
PackageManager packman_1(dg_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_1(dg_1); | |
PackageManager const packman_1(dg_1); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, reverse_order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:30:
- std::vector<bool> is_visited_;
- std::stack<std::string> reverse_order_;
+ std::vector<bool> is_visited_{};
+ std::stack<std::string> reverse_order_{};
|
||
private: | ||
void FindingOrderStep(std::shared_ptr<Vertex<std::string>> target); | ||
DependencyGraph& dependencies_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member 'dependencies_' of type 'DependencyGraph &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
DependencyGraph& dependencies_;
^
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
} | ||
|
||
TEST(NetworkTest, SimpleTriangleWithBridge) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, NoBridgesOrCutVertices) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, LineGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, EmptyGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 20. Check the log or trigger a new build to see more.
for (const auto &neighbor : vertex->adjacent) { | ||
std::cout << neighbor->data << " "; | ||
} | ||
std::cout << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
std::cout << std::endl; | |
std::cout << '\n'; |
lib/src/graph.hpp
Outdated
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<Vertex<T>>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<Vertex<T>>> vertices_;
^
task_01/src/main.cpp
Outdated
dg_1.AddDirEdge(3, 1); | ||
dg_1.AddDirEdge(0, 3); | ||
|
||
PackageManager packman_1(dg_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_1(dg_1); | |
PackageManager const packman_1(dg_1); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, reverse_order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:30:
- std::vector<bool> is_visited_;
- std::stack<std::string> reverse_order_;
+ std::vector<bool> is_visited_{};
+ std::stack<std::string> reverse_order_{};
|
||
private: | ||
void FindingOrderStep(std::shared_ptr<Vertex<std::string>> target); | ||
DependencyGraph& dependencies_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member 'dependencies_' of type 'DependencyGraph &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
DependencyGraph& dependencies_;
^
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
} | ||
|
||
TEST(NetworkTest, SimpleTriangleWithBridge) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, NoBridgesOrCutVertices) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, LineGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, EmptyGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 40. Check the log or trigger a new build to see more.
lib/src/graph.hpp
Outdated
}; | ||
|
||
template<typename T, typename VT> | ||
concept IsVertex = std::derived_from<T, Vertex<VT>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'T' does not refer to a value [clang-diagnostic-error]
concept IsVertex = std::derived_from<T, Vertex<VT>>;
^
Additional context
lib/src/graph.hpp:19: declared here
template<typename T, typename VT>
^
lib/src/graph.hpp
Outdated
}; | ||
|
||
template<typename T, typename VT> | ||
concept IsVertex = std::derived_from<T, Vertex<VT>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: a template declaration can only declare a single entity [clang-diagnostic-error]
concept IsVertex = std::derived_from<T, Vertex<VT>>;
^
lib/src/graph.hpp
Outdated
}; | ||
|
||
template<typename T, typename VT> | ||
concept IsVertex = std::derived_from<T, Vertex<VT>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no member named 'derived_from' in namespace 'std' [clang-diagnostic-error]
concept IsVertex = std::derived_from<T, Vertex<VT>>;
^
lib/src/graph.hpp
Outdated
}; | ||
|
||
template<typename T, typename VT> | ||
concept IsVertex = std::derived_from<T, Vertex<VT>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'concept' [clang-diagnostic-error]
concept IsVertex = std::derived_from<T, Vertex<VT>>;
^
lib/src/graph.hpp
Outdated
/// @brief Basic graph | ||
/// @tparam VertexType | ||
/// @tparam T | ||
template <typename VertexType, typename T> requires IsVertex<VertexType, T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: expected ';' at end of declaration [clang-diagnostic-error]
template <typename VertexType, typename T> requires IsVertex<VertexType, T>
^
this fix will not be applied because it overlaps with another fix
vertices_.push_back(std::make_shared<VertexType>(data)); | ||
}; | ||
|
||
std::shared_ptr<VertexType> operator[](size_t index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]
std::shared_ptr<VertexType> operator[](size_t index) {
^
return vertices_[index]; | ||
} | ||
|
||
const std::shared_ptr<VertexType> operator[](size_t index) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]
const std::shared_ptr<VertexType> operator[](size_t index) const {
^
* @param vertex | ||
* @return size_t | ||
*/ | ||
size_t Find(const T &vertex) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'T' [clang-diagnostic-error]
size_t Find(const T &vertex) const {
^
* Remove a vertex from the graph | ||
* @param vertex | ||
*/ | ||
virtual void RemoveVertex(std::shared_ptr<VertexType> vertex) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]
virtual void RemoveVertex(std::shared_ptr<VertexType> vertex) {
^
* @param source | ||
* @param target | ||
*/ | ||
virtual void AddDirEdge(std::shared_ptr<VertexType> source, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]
virtual void AddDirEdge(std::shared_ptr<VertexType> source,
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 31. Check the log or trigger a new build to see more.
lib/src/graph.hpp
Outdated
}; | ||
|
||
template <typename T, typename VT> | ||
concept IsVertex = std::derived_from<T, Vertex<VT>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'T' does not refer to a value [clang-diagnostic-error]
concept IsVertex = std::derived_from<T, Vertex<VT>>;
^
Additional context
lib/src/graph.hpp:19: declared here
template <typename T, typename VT>
^
/// @tparam VertexType | ||
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: expected ';' at end of declaration [clang-diagnostic-error]
requires IsVertex<VertexType, T> | |
requires IsVertex<VertexType, T>; |
/// @tparam VertexType | ||
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'requires' [clang-diagnostic-error]
requires IsVertex<VertexType, T>
^
/// @tparam VertexType | ||
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list [clang-diagnostic-error]
requires IsVertex<VertexType, T> | |
requires IsVertex |
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: vertices_ [cppcoreguidelines-pro-type-member-init]
lib/src/graph.hpp:209:
- std::vector<std::shared_ptr<VertexType>> vertices_;
+ std::vector<std::shared_ptr<VertexType>> vertices_{};
* @param vertex_2 | ||
*/ | ||
virtual void AddEdge(std::shared_ptr<VertexType> vertex_1, | ||
std::shared_ptr<VertexType> vertex_2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]
std::shared_ptr<VertexType> vertex_2) {
^
* @param vertex_1 | ||
* @param vertex_2 | ||
*/ | ||
virtual void RemoveEdge(std::shared_ptr<VertexType> vertex_1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]
virtual void RemoveEdge(std::shared_ptr<VertexType> vertex_1,
^
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<VertexType>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<VertexType>> vertices_;
^
task_01/src/main.cpp
Outdated
dg_1.AddDirEdge(3, 1); | ||
dg_1.AddDirEdge(0, 3); | ||
|
||
PackageManager packman_1(dg_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_1(dg_1); | |
PackageManager const packman_1(dg_1); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, reverse_order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:36:
- std::vector<bool> is_visited_;
- std::stack<std::string> reverse_order_;
+ std::vector<bool> is_visited_{};
+ std::stack<std::string> reverse_order_{};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 25. Check the log or trigger a new build to see more.
}; | ||
|
||
template <typename T, typename VT> | ||
concept IsVertex = std::is_base_of<Vertex<VT>, T>::value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'concept' [clang-diagnostic-error]
concept IsVertex = std::is_base_of<Vertex<VT>, T>::value;
^
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: vertices_ [cppcoreguidelines-pro-type-member-init]
lib/src/graph.hpp:209:
- std::vector<std::shared_ptr<VertexType>> vertices_;
+ std::vector<std::shared_ptr<VertexType>> vertices_{};
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: destructor of 'Graph' is public and non-virtual [cppcoreguidelines-virtual-class-destructor]
class Graph {
^
Additional context
lib/src/graph.hpp:27: make it public and virtual
class Graph {
^
* @param data | ||
*/ | ||
virtual void AddVertex(const T &data) { | ||
vertices_.push_back(std::make_shared<VertexType>(data)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]
vertices_.push_back(std::make_shared<VertexType>(data));
^
* @param vertex_2 | ||
*/ | ||
virtual void RemoveEdge(std::shared_ptr<VertexType> vertex_1, | ||
std::shared_ptr<VertexType> vertex_2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use of undeclared identifier 'VertexType' [clang-diagnostic-error]
std::shared_ptr<VertexType> vertex_2) {
^
task_01/src/test.cpp
Outdated
|
||
dg_1.AddDirEdge(0, 1); | ||
|
||
PackageManager packman_1(dg_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_1' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_1(dg_1); | |
PackageManager const packman_1(dg_1); |
task_01/src/test.cpp
Outdated
|
||
dg_2.AddDirEdge(0, 1); | ||
|
||
PackageManager packman_2(dg_2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_2' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_2(dg_2); | |
PackageManager const packman_2(dg_2); |
task_01/src/test.cpp
Outdated
dg_3.AddDirEdge(2, 3); | ||
dg_3.AddDirEdge(3, 4); | ||
|
||
PackageManager packman_3(dg_3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_3' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_3(dg_3); | |
PackageManager const packman_3(dg_3); |
task_01/src/test.cpp
Outdated
dg_4.AddDirEdge(4, 6); | ||
dg_4.AddDirEdge(5, 7); | ||
dg_4.AddDirEdge(6, 7); | ||
PackageManager packman_4(dg_4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman_4' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman_4(dg_4); | |
PackageManager const packman_4(dg_4); |
|
||
int main() { | ||
// Create a graph to represent the network | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 21. Check the log or trigger a new build to see more.
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: vertices_ [cppcoreguidelines-pro-type-member-init]
lib/src/graph.hpp:209:
- std::vector<std::shared_ptr<VertexType>> vertices_;
+ std::vector<std::shared_ptr<VertexType>> vertices_{};
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: destructor of 'Graph' is public and non-virtual [cppcoreguidelines-virtual-class-destructor]
class Graph {
^
Additional context
lib/src/graph.hpp:27: make it public and virtual
class Graph {
^
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<VertexType>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<VertexType>> vertices_;
^
dg.AddDirEdge(3, 1); // Lib_4 depends on Lib_2 | ||
dg.AddDirEdge(0, 3); // Lib_1 depends on Lib_4 | ||
|
||
PackageManager packman(dg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman(dg); | |
PackageManager const packman(dg); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:35:
- std::vector<bool> is_visited_;
- std::queue<std::string> order_;
+ std::vector<bool> is_visited_{};
+ std::queue<std::string> order_{};
|
||
int main() { | ||
// Create a graph to represent the network | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
} | ||
|
||
TEST(NetworkTest, SimpleTriangleWithBridge) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, NoBridgesOrCutVertices) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, LineGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 21. Check the log or trigger a new build to see more.
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: vertices_ [cppcoreguidelines-pro-type-member-init]
lib/src/graph.hpp:209:
- std::vector<std::shared_ptr<VertexType>> vertices_;
+ std::vector<std::shared_ptr<VertexType>> vertices_{};
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: destructor of 'Graph' is public and non-virtual [cppcoreguidelines-virtual-class-destructor]
class Graph {
^
Additional context
lib/src/graph.hpp:27: make it public and virtual
class Graph {
^
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<VertexType>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<VertexType>> vertices_;
^
dg.AddDirEdge(3, 1); // Lib_4 depends on Lib_2 | ||
dg.AddDirEdge(0, 3); // Lib_1 depends on Lib_4 | ||
|
||
PackageManager packman(dg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman(dg); | |
PackageManager const packman(dg); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:38:
- std::vector<bool> is_visited_;
- std::queue<std::string> order_;
+ std::vector<bool> is_visited_{};
+ std::queue<std::string> order_{};
|
||
int main() { | ||
// Create a graph to represent the network | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
} | ||
|
||
TEST(NetworkTest, SimpleTriangleWithBridge) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, NoBridgesOrCutVertices) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, LineGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 25. Check the log or trigger a new build to see more.
#include <string> | ||
#include <vector> | ||
|
||
#include "graph.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'graph.hpp' file not found [clang-diagnostic-error]
#include "graph.hpp"
^
#include "graph.hpp" | ||
|
||
/// @brief Type of user data | ||
enum Type { Name, Email }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: enum 'Type' uses a larger base type ('unsigned int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size [performance-enum-size]
enum Type { Name, Email };
^
|
||
/// @brief User with a name and email | ||
struct User { | ||
User(const std::string& name, const std::set<std::string>& emails) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: emails [cppcoreguidelines-pro-type-member-init]
additional_tasks/merge_users/src/merge_users.hpp:31:
- std::set<std::string> emails; // set to avoid duplicates
+ std::set<std::string> emails{}; // set to avoid duplicates
@@ -0,0 +1,144 @@ | |||
#include <gtest/gtest.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'gtest/gtest.h' file not found [clang-diagnostic-error]
#include <gtest/gtest.h>
^
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: vertices_ [cppcoreguidelines-pro-type-member-init]
lib/src/graph.hpp:209:
- std::vector<std::shared_ptr<VertexType>> vertices_;
+ std::vector<std::shared_ptr<VertexType>> vertices_{};
|
||
dg.AddDirEdge(1, 0); | ||
|
||
PackageManager packman(dg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman(dg); | |
PackageManager const packman(dg); |
|
||
dg.AddDirEdge(1, 0); | ||
|
||
PackageManager packman(dg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman(dg); | |
PackageManager const packman(dg); |
dg.AddDirEdge(3, 2); | ||
dg.AddDirEdge(4, 3); | ||
|
||
PackageManager packman(dg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman(dg); | |
PackageManager const packman(dg); |
dg.AddDirEdge(7, 5); | ||
dg.AddDirEdge(7, 6); | ||
|
||
PackageManager packman(dg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman(dg); | |
PackageManager const packman(dg); |
|
||
int main() { | ||
// Create a graph to represent the network | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 21. Check the log or trigger a new build to see more.
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: vertices_ [cppcoreguidelines-pro-type-member-init]
lib/src/graph.hpp:209:
- std::vector<std::shared_ptr<VertexType>> vertices_;
+ std::vector<std::shared_ptr<VertexType>> vertices_{};
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: destructor of 'Graph' is public and non-virtual [cppcoreguidelines-virtual-class-destructor]
class Graph {
^
Additional context
lib/src/graph.hpp:27: make it public and virtual
class Graph {
^
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<VertexType>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<VertexType>> vertices_;
^
dg.AddDirEdge(3, 1); // Lib_4 depends on Lib_2 | ||
dg.AddDirEdge(0, 3); // Lib_1 depends on Lib_4 | ||
|
||
PackageManager packman(dg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman(dg); | |
PackageManager const packman(dg); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:38:
- std::vector<bool> is_visited_;
- std::queue<std::string> order_;
+ std::vector<bool> is_visited_{};
+ std::queue<std::string> order_{};
|
||
int main() { | ||
// Create a graph to represent the network | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
} | ||
|
||
TEST(NetworkTest, SimpleTriangleWithBridge) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, NoBridgesOrCutVertices) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, LineGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 15 out of 21. Check the log or trigger a new build to see more.
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: vertices_ [cppcoreguidelines-pro-type-member-init]
lib/src/graph.hpp:209:
- std::vector<std::shared_ptr<VertexType>> vertices_;
+ std::vector<std::shared_ptr<VertexType>> vertices_{};
/// @tparam T | ||
template <typename VertexType, typename T> | ||
requires IsVertex<VertexType, T> | ||
class Graph { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: destructor of 'Graph' is public and non-virtual [cppcoreguidelines-virtual-class-destructor]
class Graph {
^
Additional context
lib/src/graph.hpp:27: make it public and virtual
class Graph {
^
} | ||
|
||
protected: | ||
std::vector<std::shared_ptr<VertexType>> vertices_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member variable 'vertices_' has protected visibility [cppcoreguidelines-non-private-member-variables-in-classes]
std::vector<std::shared_ptr<VertexType>> vertices_;
^
dg.AddDirEdge(3, 1); // Lib_4 depends on Lib_2 | ||
dg.AddDirEdge(0, 3); // Lib_1 depends on Lib_4 | ||
|
||
PackageManager packman(dg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'packman' of type 'PackageManager' can be declared 'const' [misc-const-correctness]
PackageManager packman(dg); | |
PackageManager const packman(dg); |
class PackageManager { | ||
public: | ||
PackageManager() = delete; | ||
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: is_visited_, order_ [cppcoreguidelines-pro-type-member-init]
task_01/src/packman.hpp:38:
- std::vector<bool> is_visited_;
- std::queue<std::string> order_;
+ std::vector<bool> is_visited_{};
+ std::queue<std::string> order_{};
|
||
int main() { | ||
// Create a graph to represent the network | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
low[vertex_id] = disc[vertex_id] = time++; | ||
|
||
// Counter of child nodes DFS traversal tree (for cut vertices) | ||
int children = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'children' of type 'int' can be declared 'const' [misc-const-correctness]
int children = 0; | |
int const children = 0; |
} | ||
|
||
TEST(NetworkTest, SimpleTriangleWithBridge) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, NoBridgesOrCutVertices) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
} | ||
|
||
TEST(NetworkTest, LineGraph) { | ||
Network network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'network' of type 'Network' can be declared 'const' [misc-const-correctness]
Network network; | |
Network const network; |
topology sort algorithm (further will be extended to package manger simulating prorgram)