Skip to content

Commit

Permalink
CppCheck annotations in PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed May 30, 2024
1 parent ee18191 commit f1b8a05
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
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(logp1((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] = logp1(-B[d]);
B[d] = 1. / B[d];
}
else
Expand Down

0 comments on commit f1b8a05

Please sign in to comment.