Locally suppress Code Analyzer warnings?

4 ビュー (過去 30 日間)
Steven
Steven 2023 年 11 月 27 日
コメント済み: Steven 2023 年 11 月 27 日
When I run the Code Analyser (or CodeIssues) the vast majority of the warnings (55 out of 69) are unused event arguments for callbacks in the mlapp file.
I would like to suppress each of those warnings once I've checked that the argument in that specific function is not used. I'd like to keep the warning for other functions.
In the mlapp file, is there a way to suppress this warning locally? Ideally close to the place where the issue occurs.
It would also be useful to know how to suppress the 'info' messages locally. For example I use str2num(text, Evaluation="restricted") , but get an info message with every used suggesting I use str2double(). Again, I'd like to do this locally because some uses of srt2num() might actually be better replaced with str2double().

回答 (1 件)

Steven Lord
Steven Lord 2023 年 11 月 27 日
See the "Adjust Code Analyzer Message Indicators and Messages" section on this documentation page.
  1 件のコメント
Steven
Steven 2023 年 11 月 27 日
I don’t see how that works in mlapp files where you can’t right-click the function name of a callback. Or I’ve missed something.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDebugging and Analysis についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by