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

CppCheck annotations in PRs #2130

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: cppcheck-annotations

on:
pull_request:

jobs:
build:
name: cppcheck-annotations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Run cppcheck-annotation-action
uses: Konstantin343/[email protected]
with:
std: 'c++20'
sources: 'src'
platform: 'unix64'
log-level: 'verbose'

- name: Annotate lines with errors
uses: yuzutech/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
title: 'Results of CppCheck'
input: 'annotations.json'
2 changes: 1 addition & 1 deletion src/libs/antares/study/runtime/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void StudyRuntimeInfosInitializeAllAreas(Study& study, StudyRuntimeInfos&
// E' = ln(e) - 0.5 * ln(1 + (s*s) / (e*e))
// S' = sqrt(ln(1 + (s*s) / (e*e)))
nE = log(e[i]) - 0.5 * log(1. + (s[i] * s[i]) / (e[i] * e[i]));
nS = sqrt(log(1. + (s[i] * s[i]) / (e[i] * e[i])));
nS = sqrt(log1p((s[i] * s[i]) / (e[i] * e[i])));

// asserts
assert(!std::isnan(nE)
Expand Down
2 changes: 1 addition & 1 deletion src/solver/ts-generator/availability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void GeneratorTempData::prepareIndispoFromLaw(Data::StatisticalLaw law,
B[d] = sqrt(B[d]) - 1.;
B[d] /= 2. * xtemp;
A[d] = D - 1. / B[d];
B[d] = log(1. - B[d]);
B[d] = log1p(-B[d]);
B[d] = 1. / B[d];
}
else
Expand Down
Loading