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

semester_tasks #13

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

Conversation

Stargazer2005
Copy link

topology sort algorithm (further will be extended to package manger simulating prorgram)

Copy link

@github-actions github-actions bot left a 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;

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]

Suggested change
std::cout << std::endl;
std::cout << '\n';

task_01/src/packman.hpp Show resolved Hide resolved
task_01/src/packman.hpp Show resolved Hide resolved

private:
void FindingOrderStep(std::shared_ptr<Vertex<std::string>> target);
DependencyGraph& dependencies_;

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_;
                   ^


dg_1.AddDirEdge(0, 1);

PackageManager packman_1(dg_1);

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]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);


dg_2.AddDirEdge(0, 1);

PackageManager packman_2(dg_2);

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]

Suggested change
PackageManager packman_2(dg_2);
PackageManager const packman_2(dg_2);

dg_3.AddDirEdge(2, 3);
dg_3.AddDirEdge(3, 4);

PackageManager packman_3(dg_3);

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]

Suggested change
PackageManager packman_3(dg_3);
PackageManager const packman_3(dg_3);

dg_4.AddDirEdge(4, 6);
dg_4.AddDirEdge(5, 7);
dg_4.AddDirEdge(6, 7);
PackageManager packman_4(dg_4);

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]

Suggested change
PackageManager packman_4(dg_4);
PackageManager const packman_4(dg_4);

Copy link

@github-actions github-actions bot left a 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;

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]

Suggested change
std::cout << std::endl;
std::cout << '\n';


dg_1.AddDirEdge(0, 1);

PackageManager packman_1(dg_1);

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]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);


dg_2.AddDirEdge(0, 1);

PackageManager packman_2(dg_2);

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]

Suggested change
PackageManager packman_2(dg_2);
PackageManager const packman_2(dg_2);

dg_3.AddDirEdge(2, 3);
dg_3.AddDirEdge(3, 4);

PackageManager packman_3(dg_3);

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]

Suggested change
PackageManager packman_3(dg_3);
PackageManager const packman_3(dg_3);

dg_4.AddDirEdge(4, 6);
dg_4.AddDirEdge(5, 7);
dg_4.AddDirEdge(6, 7);
PackageManager packman_4(dg_4);

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]

Suggested change
PackageManager packman_4(dg_4);
PackageManager const packman_4(dg_4);

@Stargazer2005 Stargazer2005 changed the title task_01 semestr_tasks Oct 31, 2024
@Stargazer2005 Stargazer2005 changed the title semestr_tasks semester_tasks Oct 31, 2024
Copy link

@github-actions github-actions bot left a 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;

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]

Suggested change
std::cout << std::endl;
std::cout << '\n';

}

protected:
std::vector<std::shared_ptr<Vertex<T>>> vertices_;

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} {}

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_;

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>

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>
         ^

dg_4.AddDirEdge(4, 6);
dg_4.AddDirEdge(5, 7);
dg_4.AddDirEdge(6, 7);
PackageManager packman_4(dg_4);

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]

Suggested change
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;

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]

Suggested change
int children = 0;
int const children = 0;

std::vector<std::pair<int, int>> bridges;
std::vector<int> cut_vertices;

int time = 0;

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]

Suggested change
int time = 0;
int const time = 0;

@@ -0,0 +1,16 @@
#pragma once

#include "graph.hpp"

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>

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>
         ^

Copy link

@github-actions github-actions bot left a 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;
Copy link

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]

Suggested change
std::cout << std::endl;
std::cout << '\n';

}

protected:
std::vector<std::shared_ptr<Vertex<T>>> vertices_;
Copy link

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_;
                                          ^

dg_1.AddDirEdge(3, 1);
dg_1.AddDirEdge(0, 3);

PackageManager packman_1(dg_1);
Copy link

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]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}
Copy link

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_;
Copy link

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;
Copy link

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]

Suggested change
int children = 0;
int const children = 0;

}

TEST(NetworkTest, SimpleTriangleWithBridge) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, NoBridgesOrCutVertices) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, LineGraph) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, EmptyGraph) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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;

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]

Suggested change
std::cout << std::endl;
std::cout << '\n';

}

protected:
std::vector<std::shared_ptr<Vertex<T>>> vertices_;

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_;
                                          ^

dg_1.AddDirEdge(3, 1);
dg_1.AddDirEdge(0, 3);

PackageManager packman_1(dg_1);

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]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}

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_;

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;

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]

Suggested change
int children = 0;
int const children = 0;

}

TEST(NetworkTest, SimpleTriangleWithBridge) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, NoBridgesOrCutVertices) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, LineGraph) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, EmptyGraph) {
Network network;

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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;

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]

Suggested change
std::cout << std::endl;
std::cout << '\n';

}

protected:
std::vector<std::shared_ptr<Vertex<T>>> vertices_;

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_;
                                          ^

dg_1.AddDirEdge(3, 1);
dg_1.AddDirEdge(0, 3);

PackageManager packman_1(dg_1);

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]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}

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_;

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;

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]

Suggested change
int children = 0;
int const children = 0;

}

TEST(NetworkTest, SimpleTriangleWithBridge) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, NoBridgesOrCutVertices) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, LineGraph) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, EmptyGraph) {
Network network;

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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;

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]

Suggested change
std::cout << std::endl;
std::cout << '\n';

}

protected:
std::vector<std::shared_ptr<Vertex<T>>> vertices_;

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_;
                                          ^

dg_1.AddDirEdge(3, 1);
dg_1.AddDirEdge(0, 3);

PackageManager packman_1(dg_1);

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]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}

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_;

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;

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]

Suggested change
int children = 0;
int const children = 0;

}

TEST(NetworkTest, SimpleTriangleWithBridge) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, NoBridgesOrCutVertices) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, LineGraph) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, EmptyGraph) {
Network network;

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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.

};

template<typename T, typename VT>
concept IsVertex = std::derived_from<T, Vertex<VT>>;

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>
                  ^

};

template<typename T, typename VT>
concept IsVertex = std::derived_from<T, Vertex<VT>>;

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>>;
                                      ^

};

template<typename T, typename VT>
concept IsVertex = std::derived_from<T, Vertex<VT>>;

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>>;
                        ^

};

template<typename T, typename VT>
concept IsVertex = std::derived_from<T, Vertex<VT>>;

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>>;
^

/// @brief Basic graph
/// @tparam VertexType
/// @tparam T
template <typename VertexType, typename T> requires IsVertex<VertexType, T>

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) {

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 {

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 {

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) {

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,

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,
                                          ^

Copy link

@github-actions github-actions bot left a 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.

};

template <typename T, typename VT>
concept IsVertex = std::derived_from<T, Vertex<VT>>;

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>

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]

Suggested change
requires IsVertex<VertexType, T>
requires IsVertex<VertexType, T>;

/// @tparam VertexType
/// @tparam T
template <typename VertexType, typename T>
requires IsVertex<VertexType, T>

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>

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]

Suggested change
requires IsVertex<VertexType, T>
requires IsVertex

/// @tparam T
template <typename VertexType, typename T>
requires IsVertex<VertexType, T>
class Graph {

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) {

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,

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_;

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_1.AddDirEdge(3, 1);
dg_1.AddDirEdge(0, 3);

PackageManager packman_1(dg_1);

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]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}

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_{};

Copy link

@github-actions github-actions bot left a 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;

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 {

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 {

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));

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) {

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) {
                                          ^


dg_1.AddDirEdge(0, 1);

PackageManager packman_1(dg_1);

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]

Suggested change
PackageManager packman_1(dg_1);
PackageManager const packman_1(dg_1);


dg_2.AddDirEdge(0, 1);

PackageManager packman_2(dg_2);

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]

Suggested change
PackageManager packman_2(dg_2);
PackageManager const packman_2(dg_2);

dg_3.AddDirEdge(2, 3);
dg_3.AddDirEdge(3, 4);

PackageManager packman_3(dg_3);

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]

Suggested change
PackageManager packman_3(dg_3);
PackageManager const packman_3(dg_3);

dg_4.AddDirEdge(4, 6);
dg_4.AddDirEdge(5, 7);
dg_4.AddDirEdge(6, 7);
PackageManager packman_4(dg_4);

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]

Suggested change
PackageManager packman_4(dg_4);
PackageManager const packman_4(dg_4);


int main() {
// Create a graph to represent the network
Network network;

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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 {

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 {

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_;

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);

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]

Suggested change
PackageManager packman(dg);
PackageManager const packman(dg);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}

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;

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]

Suggested change
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;

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]

Suggested change
int children = 0;
int const children = 0;

}

TEST(NetworkTest, SimpleTriangleWithBridge) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, NoBridgesOrCutVertices) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, LineGraph) {
Network network;

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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 {

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 {

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_;

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);

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]

Suggested change
PackageManager packman(dg);
PackageManager const packman(dg);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}

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;

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]

Suggested change
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;

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]

Suggested change
int children = 0;
int const children = 0;

}

TEST(NetworkTest, SimpleTriangleWithBridge) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, NoBridgesOrCutVertices) {
Network network;

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, LineGraph) {
Network network;

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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"
Copy link

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 };
Copy link

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)
Copy link

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>
Copy link

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 {
Copy link

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);
Copy link

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]

Suggested change
PackageManager packman(dg);
PackageManager const packman(dg);


dg.AddDirEdge(1, 0);

PackageManager packman(dg);
Copy link

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]

Suggested change
PackageManager packman(dg);
PackageManager const packman(dg);

dg.AddDirEdge(3, 2);
dg.AddDirEdge(4, 3);

PackageManager packman(dg);
Copy link

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]

Suggested change
PackageManager packman(dg);
PackageManager const packman(dg);

dg.AddDirEdge(7, 5);
dg.AddDirEdge(7, 6);

PackageManager packman(dg);
Copy link

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]

Suggested change
PackageManager packman(dg);
PackageManager const packman(dg);


int main() {
// Create a graph to represent the network
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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 {
Copy link

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 {
Copy link

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_;
Copy link

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);
Copy link

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]

Suggested change
PackageManager packman(dg);
PackageManager const packman(dg);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}
Copy link

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;
Copy link

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]

Suggested change
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;
Copy link

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]

Suggested change
int children = 0;
int const children = 0;

}

TEST(NetworkTest, SimpleTriangleWithBridge) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, NoBridgesOrCutVertices) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, LineGraph) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

Copy link

@github-actions github-actions bot left a 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 {
Copy link

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 {
Copy link

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_;
Copy link

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);
Copy link

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]

Suggested change
PackageManager packman(dg);
PackageManager const packman(dg);

class PackageManager {
public:
PackageManager() = delete;
PackageManager(DependencyGraph& dep_graph) : dependencies_{dep_graph} {}
Copy link

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;
Copy link

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]

Suggested change
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;
Copy link

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]

Suggested change
int children = 0;
int const children = 0;

}

TEST(NetworkTest, SimpleTriangleWithBridge) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, NoBridgesOrCutVertices) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

}

TEST(NetworkTest, LineGraph) {
Network network;
Copy link

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]

Suggested change
Network network;
Network const network;

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.

1 participant