HIS Code Metrics justification
20 次查看(过去 30 天)
显示 更早的评论
Hello,
does anyone know how to justify HIS findings in code?
I have tried:
/* polyspace<Custom:Language Scope:Not a defect:Justify with annotations> The code is difficult because it's highly optimized. */
/* polyspace<Custom Number of Called Functions:Not a defect:Justify with annotations> The amout of called functions is necessary due to readability and functionality */
/* polyspace<Custom VOCF:Not a defect:Justify with annotations> The amout of called functions is necessary due to readability and functionality */
But with no luck.
I know that normally I use the same format of comment with MISRA or RTE findings.
I am using polyspace check for C++ code.
0 个评论
采纳的回答
Anirban
2022-10-12
You have to use:
/* polyspace CODE-METRICS: VOCF [Not a defect:Low] The amount of called functions is necessary due to readability and functionality */
.
6 个评论
Anirban
2022-11-22
Correcting my previous answer: it seems file metrics cannot be justified. However, language scope and number of called functions are function metrics, not file metrics, and should be justifiable. For instance, you can try the example below and see that the language scope is justified:
int g(int);
int f(int i) /* polyspace CODE-METRIC:VOCF [No action planned:Low] "The amount of called functions is necessary due to readability and functionality." */
{
if (i == 1)
return i;
else
return i * g(i-1);
}
About the reason why language scope and number of called functions are coming at the beginning of the file instead of next to a function definiton, I am not sure. Please contact MathWorks Technical Support for more help with the problem: https://www.mathworks.com/support/contact_us.html
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Coding Standards and Code Metrics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!