padv.builtin.task.AnalyzeModelCode Class
Namespace: padv.builtin.task
Superclasses: padv.Task
Task for checking coding standards or proving code quality with Polyspace
Description
The padv.builtin.task.AnalyzeModelCode
class provides a task that you can
configure to either:
Check coding standards by using Polyspace® Bug Finder™
Prove code quality by using Polyspace Code Prover™
You configure which operation the task performs by specifying the VerificationMode
property. If you want to use both Bug Finder and Code Prover, add two instances of
AnalyzeModelCode
to the process model as shown in Add Both Bug Finder and Code Prover Tasks to Process. If you have a Polyspace
Access™ license, you can also configure the task to upload your results. For more
information, see Upload Results to Polyspace Access.
You can add the task to your process model by using the method addTask
.
After you add the task, you can run the task from the Process Advisor app or
by using the function runprocess
.
To view the source code for this built-in task, in the MATLAB® Command Window, enter:
open padv.builtin.task.AnalyzeModelCode
The padv.builtin.task.AnalyzeModelCode
class is a handle
class.
Note
Polyspace Bug Finder, Polyspace Code Prover, and this task are not supported on Apple silicon macOS.
Creation
Description
creates a task for checking coding standards with Polyspace
Bug Finder.task
= padv.builtin.task.AnalyzeModelCode()
specifies that the task can only execute after the specified predecessor task runs.task
= padv.builtin.task.AnalyzeModelCode(PredecessorTask=PredecessorTask
)
When you specify a predecessor task, you must also specify a dependsOn
relationship between the AnalyzeModelCode
task and the predecessor task in
your process model.
sets certain properties using one or more name-value arguments.task
= padv.builtin.task.AnalyzeModelCode(___,Name=Value
)
For example, task = padv.builtin.task.AnalyzeModelCode(Name =
"MyAnalyzeModelCode")
creates a task with the specified name.
You can use this syntax to set property values for
TreatAsRefModel
, Name
,
Title
, DescriptionText
,
DescriptionCSH
, IterationQuery
,
InputQueries
, InputDependencyQuery
,
LaunchToolAction
, and LaunchToolText
.
The class also has other properties, but you cannot set those properties during task creation.
Input Arguments
Properties
Methods
Examples
Tips
This task runs on the generated model code, iterating over either each model in the project or the project itself. If a model does not have generated code, the task skips the model and displays a warning message. You can generate code as part of your process by using the built-in task
padv.builtin.task.GenerateCode
and then analyze the generated code using theAnalyzeModelCode
task. You can add these tasks to your process model by using the methodaddTask
.This task requires that your Polyspace installation is integrated with MATLAB and Simulink. If you have not already integrated your installation, use the function
polyspacesetup
. For information, see Integrate Polyspace with MATLAB and Simulink (Polyspace Bug Finder).If you start MATLAB with the
-batch
option, the task requires a Polyspace server product. The required server product depends on the task configuration:Check Coding Standards (default) — Requires the Polyspace Bug Finder Server™ product.
Prove Code Quality — Requires the Polyspace Code Prover Server product.
You can use both Bug Finder and Code Prover in your software development workflow. For information on how to include both a Bug Finder task and a Code Prover task in your process model, see Add Both Bug Finder and Code Prover Tasks to Process.
For information on the differences between Bug Finder and Code Prover, see Differences Between Polyspace Bug Finder and Polyspace Code Prover (Polyspace Bug Finder).