Skip to content

Commit

Permalink
Fix sonar issues (#789)
Browse files Browse the repository at this point in the history
* Sonar ignore for Python RNG

* More ignores
  • Loading branch information
garth-wells authored Feb 14, 2024
1 parent 24c4b27 commit 2e2a704
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/basix/cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,13 @@ T cell::volume(cell::type cell_type)
case cell::type::quadrilateral:
return 1;
case cell::type::tetrahedron:
return 1.0 / 6;
return 1.0 / 6.0;
case cell::type::hexahedron:
return 1;
case cell::type::prism:
return 0.5;
case cell::type::pyramid:
return 1.0 / 3;
return 1.0 / 3.0;
default:
throw std::runtime_error("Unsupported cell type");
}
Expand Down
15 changes: 15 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ sonar.organization=fenics

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

# Set python version
sonar.python.version=3.9, 3.10, 3.11, 3.12

# Exclude mdspan
sonar.exclusions=cpp/basix/mdspan.hpp

# sonar.issue.ignore.multicriteria.S2245.resourceKey=**/*
sonar.issue.ignore.multicriteria.S2245.ruleKey=python:S2245
sonar.issue.ignore.multicriteria.S4790.ruleKey=python:S4790

sonar.issue.ignore.multicriteria.S3659.ruleKey=cpp:S3659
sonar.issue.ignore.multicriteria.S6197.ruleKey=cpp:S6197

sonar.issue.ignore.multicriteria.S112.ruleKey=cpp:S112

0 comments on commit 2e2a704

Please sign in to comment.