Code Inspector with Legacy Code

1 次查看(过去 30 天)
John Fiaschetti
John Fiaschetti 2022-2-7
回答: Riya 2023-11-19
Hi,
I am trying to use Code Inspector in a project where the generated code has to link with a large amount of legacy hand code. I have to use certain headers from the hand code to link to the generated code, and I have added #include statements for these headers in my configuration for custom code. When I run code inspector, I get a series of warnings about not having my custom code headers and sources set to "" or unspecified.
I know why I am getting the warning, and there is no way to avoid it in my program. Short of just accepting these warnings, how do people normally handle this?
Thanks!

回答(1 个)

Riya
Riya 2023-11-19
Hello John Fiaschetti,
As per my understanding, while running code inspector, you are getting a series of warnings about not having custom code.
Please note that when dealing with legacy code and Code Inspector, there are a few approaches you can consider to handle the warnings about missing custom code headers and sources. Here are some common solutions:
  • Configure exclusion rules: Some code inspection tools provide the ability to configure exclusion rules based on specific criteria. You can create exclusion rules for the headers and sources that are part of your legacy code, so that the warnings related to these files are suppressed.
  • Create dummy headers: If the missing headers are not critical for the analysis, you can create dummy header files with empty content and include them in your configuration. This way, the Code Inspector will find the headers it expects, and the warnings will be avoided.
  • Refactor the code: If possible, consider refactoring your code to reduce the coupling between the generated code and the legacy hand code. By decoupling the dependencies, you can make the code more modular and easier to analyse with tools like Code Inspector.
Remember, the best approach may vary depending on the specifics of your project and the capabilities of the Code Inspector tool you are using.
I hope it helps!
Regards,
Riya Arora

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by