Skip to content

Conversation

@Grufoony
Copy link
Collaborator

@Grufoony Grufoony linked an issue Nov 25, 2024 that may be closed by this pull request
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
// ~/Library/Application Support/dsm/logs/
inline static auto const DSM_LOG_FOLDER =
std::format("{}/Library/Application Support/dsm/logs/", std::getenv("HOME"));

Check notice

Code scanning / Flawfinder (reported by Codacy)

Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. Note

Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them.
#else // Linux
// ~/.local/dsm/logs/
inline static auto const DSM_LOG_FOLDER =
std::format("{}/.local/dsm/logs/", std::getenv("HOME"));

Check notice

Code scanning / Flawfinder (reported by Codacy)

Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. Note

Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them.
const auto& srcNode{this->m_graph.nodeSet()[agent->srcNodeId().value()]};
if (srcNode->isFull()) {
pFileLogger->debug(
"Agent {} is not able to enter full node {}.", agentId, srcNode->id());

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
#elif __APPLE__
// %appdata%/dsm/logs
inline static auto const DSM_LOG_FOLDER =
std::format("{}\\dsm\\logs\\", std::getenv("APPDATA"));

Check notice

Code scanning / Flawfinder (reported by Codacy)

Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. Note

Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them.
required=True,
help="Place to get the OSM data in the format: city, province, country",
)
parser = parser.parse_args()

Check warning

Code scanning / Pylint (reported by Codacy)

Constant name "parser" doesn't conform to UPPER_CASE naming style Warning

Constant name "parser" doesn't conform to UPPER_CASE naming style
class Dynamics {
protected:
inline static auto const pFileLogger{spdlog::basic_logger_mt(
"DSM_DYNAMICS_FILE", std::format("{}{}", DSM_LOG_FOLDER, DSM_LOG_FILE), true)};

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
"Negative weight ({}) for source node {}.", p.second, p.first);
pConsoleLogger->critical(
"Negative weight ({}) for source node {}.", p.second, p.first);
std::abort();

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
pConsoleLogger->critical(
"Negative weight ({}) for source node {}.", p.second, p.first);
std::abort();
}

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
path.getColDim())));
pConsoleLogger->critical(
"The path's row ({}) and column ({}) dimensions must be equal.",
path.getRowDim(),

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
/// @param time The value to increment the agent's time by
/// @throw std::overflow_error, if time has reached its maximum value
void incrementTime(unsigned int time);
void incrementTime(unsigned int const time);

Check notice

Code scanning / Cppcheck (reported by Codacy)

time is Y2038-unsafe Note

time is Y2038-unsafe
template <typename Delay>
requires(is_numeric_v<Delay>)
void Agent<Delay>::incrementTime(unsigned int time) {
void Agent<Delay>::incrementTime(unsigned int const time) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

time is Y2038-unsafe Note

time is Y2038-unsafe
pConsoleLogger->critical(
"The only source node {} is also the only destination node.",
src_weights.begin()->first);
std::abort();

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
pConsoleLogger->critical(
"The only source node {} is also the only destination node.",
src_weights.begin()->first);
std::abort();

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
return false;
}
for (auto const [angle, agentId] : intersection.agents()) {
for (auto const& [angle, agentId] : intersection.agents()) {

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
pFileLogger->critical(
"Negative weight ({}) for destination node {}.", p.second, p.first);
pConsoleLogger->critical(
"Negative weight ({}) for destination node {}.", p.second, p.first);

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
@Grufoony Grufoony closed this Jan 24, 2025
@Grufoony Grufoony deleted the feature_addLogger branch January 24, 2025 10:50
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.

Add external logger

2 participants