polyspace.project.OwnedStaticAnalysisConfiguration Class
Namespace: polyspace.project
Description
The properties of the polyspace.project.OwnedStaticAnalysisConfiguration
class contain the static analysis options attached to a specific Polyspace® Platform project. These properties correspond to the options related to static
analysis in Polyspace
Bug Finder™ and Polyspace
Code Prover™. See Polyspace Bug Finder
options (Polyspace Bug Finder) and Polyspace Code Prover
options (Polyspace Code Prover).
To create modular projects, where project components like configurations and graphical
tests are saved in separate files, consider using external configurations. An external
configuration is a build, static analysis, or testing and profiling configuration that is
saved in a separate .pscfg file that is referenced by the project. To work
with external static analysis configurations in the Polyspace
Python® API see polyspace.project.StaticAnalysisConfigurationRef and polyspace.project.StaticAnalysisConfiguration. For more information about project
structure, see Modularize Project by Using External Configurations, Test References, and External Stub Files.
Creation
Syntax
Description
Create Static Analysis Configuration
creates a new staticAnalysisConfig = proj.StaticAnalysisConfigurations.create(configName)polyspace.project.OwnedStaticAnalysisConfiguration object
with the Name property set to configName and all
other properties set to their default values. The resulting
staticAnalysisConfig object is attached to the polyspace.project.Project object proj.
Load Static Analysis Configuration
loads the existing staticAnalysisConfig = proj.StaticAnalysisConfigurations[configName]polyspace.project.OwnedStaticAnalysisConfiguration
object with the Name property set to configName
from the polyspace.project.Project object proj.
Create Copy of Static Analysis Configuration
creates a new staticAnalysisConfig = proj.StaticAnalysisConfigurations.createFrom(existingConfigObj)polyspace.project.OwnedStaticAnalysisConfiguration object
by copying an existing object existingConfigObj and attaches this
copied object to the polyspace.project.Project object
proj. To assign a unique name to
staticAnalysisConfig, Polyspace uses the Name property of
existingConfigObj and appends the next available numeric
suffix.
creates a new staticAnalysisConfig = proj.StaticAnalysisConfigurations.createFrom(existingConfigObj, configName)polyspace.project.OwnedStaticAnalysisConfiguration object
by copying an existing object existingConfigObj and attaches this
copied object to the polyspace.project.Project object
proj. Use the configName argument to set the
Name property of the resulting object.
creates a new staticAnalysisConfig = proj.StaticAnalysisConfigurations.createFrom(existingConfigFile)polyspace.project.OwnedStaticAnalysisConfiguration object
by copying the static analysis configuration defined in the file
existingConfigFile.pscfg and attaches this object to the
polyspace.project.Project object proj.
creates a new staticAnalysisConfig = proj.StaticAnalysisConfigurations.createFrom(existingConfigFile, configName)polyspace.project.OwnedStaticAnalysisConfiguration object
by copying the static analysis configuration defined in the file
existingConfigFile.pscfg, and attaches this object to the
polyspace.project.Project object proj. Use the
configName argument to set the Name property
of the resulting object.
Convert Static Analysis Configuration
staticAnalysisConfig = proj.StaticAnalysisConfigurations.moveAsOwned(
converts the static analysis configuration that the project existingConfigRefObj)proj
references through existingConfigRefObj to a
polyspace.project.OwnedStaticAnalysisConfiguration object and
removes existingConfigRefObj from the project.
Input Arguments
Name of the static analysis configuration, specified as a string. This argument
sets the Name property of the object.
Example: "My Static Analysis Configuration"
Existing owned static analysis configuration to make a copy of, specified as a
polyspace.project.OwnedStaticAnalysisConfiguration object.
Example: proj.StaticAnalysisConfigurations[2]
Absolute or relative path to an existing .pscfg file, specified
as a string. Relative paths are considered relative to the location of the
.psprjx project file.
Example: "myStaticConfig.pscfg"
The existing referenced static analysis configuration that you want to convert to
a polyspace.project.OwnedStaticAnalysisConfiguration object, specified
as a polyspace.project.StaticAnalysisConfigurationRef object.
Example: proj.StaticAnalysisConfigurationRefs[0]
Properties
Name of the static analysis configuration, specified as a string. You can use this property to display the name of the configuration or assign a new name.
Example: staticConfig.Name
Example: staticConfig.Name="newConfigName"
Optional description of the static analysis configuration. Use this property to provide information about the static analysis configuration.
Example: "Static analysis configuration for mandatory MISRA C 2023
checks"
Specify commands or scripts to run after the analysis completes, or specify command-line-only options.
Specify the path of a command or script that Polyspace executes after the analysis completes. If you offload the analysis to a server machine, specify the path of the command or script on the server machine.
See also Command/script to apply after the end of the code verification (-post-analysis-command) (Polyspace Bug Finder).
Example: staticConf.Advanced.PostAnalysisCommand="/usr/local/scripts/postProcess.pl"
Specify additional static analysis options. For example, you might want to specify unofficial options provided by MathWorks® technical support to work around an issue.
To modify this property, use these methods:
append(— Add an additional analysis option.optionName)pop(— Remove the analysis option with indexoptionNameIdx)optionNameIdx. If you do not specify an index, the last option in the list is removed.clear()— Remove all additional analysis options.
See also Other (Polyspace Bug Finder).
Example: staticConf.Advanced.Other.append("-extra-flag otherOption")
Example: staticConf.Advanced.Other.pop(0)
Configure the behavior of Bug Finder checkers.
| Property | Behavior |
|---|---|
AllowedPragmas | Specify the
Polyspace reports a violation for any
To modify this property, use these methods:
Example:
Example:
See also
|
BooleanTypes | Specify data types that Polyspace treats as boolean
when checking for certain coding rule violations. You can
specify data types for this property only if you define those
data types through an To modify this property, use these methods:
Example:
Example:
For
a list of coding rules checkers that are modified by this
property, see |
ChecksUsingSystemInputValues | Enable or disable stricter checks for system inputs.
By default, this property is set to Example:
See
also |
SystemInputsFrom | Specify the functions for which Polyspace runs stricter checks for system inputs. You can specify one of these values:
To use this property, set
Example:
See
also |
SystemInputsFromValues | If you set the property
To modify this property, use these methods:
Example:
Example:
|
Enable the use of a custom selection of defect and coding rule checkers. By default, this property is set to False, and the Bug Finder analysis uses the default checkers selection. See Polyspace Bug Finder Defects Checkers Enabled by Default (Polyspace Bug Finder).
If you enable this property, use CheckersActivationFile to specify the path of the XML file where you store your custom selection of defect and coding rule checkers.
Example: staticConf.BugFinderAnalysis.EnableCheckersActivationFile=True
Specify the path of the checkers activation file when you set EnableCheckersActivationFile to True. To view the available defects and coding rule checkers, see Polyspace Bug Finder Results (Polyspace Bug Finder).
For more on how to create and edit the checkers activation file, see Checkers activation file (-checkers-activation-file) (Polyspace Bug Finder).
Example: staticConf.BugFinderAnalysis.CheckersActivationFile="/usr/local/checkersFile.xml"
If you project contains generated code, enable this property to check the compliance of the code with the MISRA C:2012 coding standard.
See also Use generated code requirements (-misra3-agc-mode) (Polyspace Bug Finder).
Example: staticConf.BugFinderAnalysis.Misra3AgcMode=True
If you project contains generated code, enable this property to check the compliance of the code with the MISRA C:2023 coding standard.
See also Use generated code requirements (-misra-c-2023-agc-mode) (Polyspace Bug Finder).
Example: staticConf.BugFinderAnalysis.MisraC2023AgcMode=True
Enable this property to calculate code complexity metrics for your project. To view a list of code metrics that Polyspace Bug Finder calculates, see HIS Code Complexity Metrics (Polyspace Bug Finder).
See also Calculate code metrics (-code-metrics) (Polyspace Bug Finder).
Example: staticConf.BugFinderAnalysis.CodeMetrics=True
Specify the files for which Polyspace generates analysis results. Files for which Polyspace does not generate results are not excluded from the analysis. Use this property to, for example, suppress results from third party library header files that you include in your code. The available values are:
"all-headers"— Polyspace generates results for all source files and all header files. The header files can be in the same folder as source files, in subfolders of source file folders or in include folders."source-headers"(default) — Polyspace generates results for the source files and the header files that are in the same folder as the source files or in subfolders of source file folders."custom"— Polyspace generates results for the source files and the folders that you specify. If you enter a folder name, results appear on header files in that folder (and its subfolders).Use
GenerateResultsForValuesto specify the file and folder paths.
See also Generate results for sources and (-generate-results-for) (Polyspace Bug Finder).
Example: staticConf.BugFinderAnalysis.GenerateResultsFor="custom"
If you set GenerateResultsFor to custom, use this property to specify the list of files and folders for which Polyspace generates results.
To modify this property, use these methods:
append(— Add a file or folder path to this property.path)pop(— Remove the file or folder path with indexpathIdx)pathIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all file and folder paths associated with this property.
Example: staticConf.BugFinderAnalysis.GenerateResultsForValues.append("/path/to/myfile.c")
Example: staticConf.BugFinderAnalysis.GenerateResultsForValues.append("/path/to/folder")
Example:
staticConf.BugFinderAnalysis.GenerateResultsForValues.pop(0)
Specify the files for which Polyspace does not generate analysis results. Files for which Polyspace does not generate results are not excluded from the analysis. Use this property to, for example, suppress results from header files that are in the same folder as the analyzed source files. The available values are:
all-headers— Polyspace does not generate results for all header files. The header files can be in the same folder as source files, in subfolders of source file folders or in include folders.source-headers(default) — Polyspace does not generate results for header files in include folders (and their subfolders).custom— Polyspace does not generate results for the files and folders that you specify. If you enter a folder name, results are suppressed from files in that folder (and its subfolders).Use
DoNotGenerateResultsForValuesto specify the file and folder paths.
See also Do not generate results for (-do-not-generate-results-for) (Polyspace Bug Finder).
Example: staticConf.BugFinderAnalysis.DoNotGenerateResultsFor="source-headers"
If you set DoNotGenerateResultsFor to custom, use this property to specify the list of files and folders for which Polyspace does not generate results.
To modify this property, use these methods:
append(— Add a file or folder path to this property.path)pop(— Remove the file or folder path with indexpathIdx)pathIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all file and folder paths associated with this property.
Example: staticConf.BugFinderAnalysis.DoNotGenerateResultsForValues.append("/path/to/folder")
Example: staticConf.BugFinderAnalysis.DoNotGenerateResultsForValues.pop(0)
Use these properties to modify the default behavior of run-time checks during a Code Prover verification. For example, specify that Polyspace check for overflows in computations that use unsigned integers in addition to the default behavior of checking for overflows in computations that use signed integers.
| Property | Behavior |
|---|---|
AllowNegativeOperandInShift | Specify that a Code Prover verification allows left shift operations on negative numbers. By default, this property is set to Example:
See also |
AllowNonFiniteFloats | Enable analysis mode that incorporates Infinites and NaNs for floating point operations. By default, this property is set to See also Example:
|
AllowPtrArithOnStruct | Specify that a pointer assigned to a structure field can point outside its bounds as long as it points within the structure. By default, this property is set to Example:
See also |
CheckGlobalsInit | Specify that Polyspace must check whether all non-const global variables (and local static variables) are explicitly initialized at declaration or within a section of code marked as initialization code. By default, this property is set to Example:
See also |
CheckInfinite | Specify how the analysis handles floating-point operations that result in infinities. The available values are:
Example:
See also |
CheckNan | Specify how the analysis handles floating-point operations that result in NaNs. The available values are:
See also Example:
|
CheckSubnormal | Specify how the analysis handles floating-point operations that result in subnormal values. The values indicate a loss of significant digits. You can set this property to:
Example:
See also |
DetectPointerEscape | Specify that Polyspace detects cases where you access a variable outside its scope via dangling pointers. By default, this property is set to Example:
See also |
DisableInitializationChecks | Specify that Polyspace does not check for non-initialized variables and pointers. By default, this property is set to Example:
See also |
ImpactAnalysis | Specify that Polyspace checks for the presence or absence of impact between program elements designated as sources and sinks. Use the property See also Example:
|
ImpactAnalysisOnly | Specify that Polyspace checks for only the presence or absence of impact between program elements designated as sources and sinks. If you enable this property Polyspace skips the Code Prover analysis for run-time errors. By default, this property is set to To use this property, set Example:
See also |
ImpactSpecifications | Specify the path of the XML file where you define the source-sink pairs for which Polyspace performs and impact analysis. To use this property, set Example:
For more information on creating and editing the XML file where you define source-sink pairs, see |
PermissiveFunctionPointer | Specify that Polyspace allows function pointer calls where the type of the function pointer does not match the type of the function. By default, this property is set to Example:
See also |
SignedIntegerOverflows | Specify how the analysis handles signed integer overflows. The available values are:
See also Example:
|
SizeInBytes | Specify that Polyspace allows dereferencing a pointer that points to a structure, but the pointer has a sufficient buffer for only some of the structure’s fields. By default, this property is set to Example:
See also |
StackUsage | Specify that Polyspace computes and displays the stack usage of your source code. By default, this property is set to Example:
See also |
UncalledFunctionChecks | Specify that Polyspace detects functions that are not called directly or indirectly from
Example:
See also |
UnsignedIntegerOverflows | Specify how the analysis handles unsigned integer overflows. The available values are:
Example:
See also |
Specify the classes that Polyspace uses to generate a main() function. By default, Polyspace uses all classes that have at least one method defined outside a header file. Polyspace generates a main() function only if one does not already exist. Otherwise, Polyspace uses the existing main() function.
To generate a main() that does not call any class method, set the property to none.
To generate a main() that uses a custom list of classes, set the property to custom and use ClassAnalyzerValues to specify the list of classes.
See also Class (-class-analyzer) (Polyspace Bug Finder).
Example: ataticConf.CodeProverVerification.ClassAnalyzer="custom"
Specify the class methods that Polyspace uses to generate a main() function. You can specify one of these values:
"all"— The generatedmaincalls all public and protected methods. It does not call methods inherited from a parent class."all-public"— The generatedmaincalls all public methods. It does not call methods inherited from a parent class."inherited-all"— The generatedmaincalls all public and protected methods including those inherited from a parent class."inherited-all-public"— The generatedmaincalls all public methods including those inherited from a parent class."unused"(default) — The generatedmaincalls public and protected methods that are not called in the code."unused-public"— The generatedmaincalls public methods that are not called in the code. It does not call methods inherited from a parent class."inherited-unused"— The generatedmaincalls public and protected methods that are not called in the code including those inherited from a parent class."inherited-unused-public"— The generatedmaincalls public methods that are not called in the code including those inherited from a parent class."custom"— The generatedmaincalls the methods that you specify. UseClassAnalyzerCallsValuesto specify the custom list of class methods.
See also Functions to call within the specified classes (-class-analyzer-calls) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.ClassAnalyzerCalls="all-public"
If you set ClassAnalyzerCalls to custom, use this property to specify a list of class methods that Polyspace uses to generate a main. Polyspace analyzes only methods that are called directly or indirectly from the main function.
To modify this property, use these methods:
append(— Add a value to this property.value)pop(— Remove the value with indexvalueIdx)valueIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all values associated with this property.
Example: staticConf.CodeProverVerification.ClassAnalyzerCallsValues.append("myClass::myMethod()")
Example: staticConf.CodeProverVerification.ClassAnalyzerCallsValues.append("myClass::myMethodWithParams(int, int)")
Example: staticConf.CodeProverVerification.ClassAnalyzerCallsValues.pop(0)
If you set ClassAnalyzer to custom, use this property to specify a list of classes that Polyspace uses to generate a main, and then use ClassAnalyzerCalls to specify the methods that the main calls. Polyspace analyzes only methods that are called directly or indirectly from the main function.
To modify this property, use these methods:
append(— Add a value to this property.value)pop(— Remove the value with indexvalueIdx)valueIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all values associated with this property.
Example: staticConf.CodeProverVerification.ClassAnalyzerValues.append("myClass")
Example: staticConf.CodeProverVerification.ClassAnalyzerValues.pop(0)
Specify that Polyspace analyze only the methods of classes that you specify with the properties ClassAnalyzer and ClassAnalyzerCalls. By default, this property is set to False.
See also Analyze class contents only (-class-only) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.ClassOnly=True
Specify the functions that the generated main() function calls ahead of other functions. Polyspace generates a main() function only if one does not already exist. Otherwise, Polyspace uses the existing main() function.
To modify this property, use these methods:
append(— Add a value to this property.value)pop(— Remove the value with indexvalueIdx)valueIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all values associated with this property.
See also Initialization functions (-functions-called-before-main) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.FunctionsCalledBeforeMain.append("myClass::myMethod()")
Example: staticConf.CodeProverVerification.FunctionsCalledBeforeMain.append("myClass::myMethodWithParams(int, int)")
Example: staticConf.CodeProverVerification.FunctionsCalledBeforeMain.pop(0)
Specify that Polyspace checks only the section of the code marked as initialization code for run-time errors and other issues.
See also Verify initialization section of code only (-init-only-mode) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.InitOnlyMode=True
Specify a Microsoft
Visual C++ extension of main that the program uses as a main function.
The extensions provide additional capabilities beyond the standard main function.
See also Main entry point (-main) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.Main="DllMain"
Specify that Polyspace generates a main() function if one does not already exist, for example, if you analyze a module or library. If a main() function already exists, the analysis uses that main() function instead.
Set this property to False to stop the analysis if no main() function exists.
See also Verify module or library (-main-generator) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.MainGenerator=False
Specify the functions that the generated main() calls after the functions you specify with the property FunctionsCalledBeforeMain. You can specify one of these values:
none— The generatedmain()does not call any function.unused(default) — The generatedmain()calls only functions that are not called anywhere else in the source code, except if those functions are inline.all— The generatedmain()calls all the functions except for inlined functions.custom— The generatedmain()calls the functions that you specify with the propertyMainGeneratorCallsValues.
See also Functions to call (-main-generator-calls) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.MainGeneratorCalls="all"
Specify a custom list of functions that the generated main() calls after the functions you specify with the property FunctionsCalledBeforeMain.
To modify this property, use these methods:
append(— Add a value to this property.value)pop(— Remove the value with indexvalueIdx)valueIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all values associated with this property.
Example: staticConf.CodeProverVerification.MainGeneratorCallsValues.append("myClass::myMethod()")
Example: staticConf.CodeProverVerification.MainGeneratorCallsValues.append("myClass::myMethodWithParams(int, int)")
Example: staticConf.CodeProverVerification.MainGeneratorCallsValues.pop(0)
Specify the global variables that the generated main() function initializes. Polyspace considers that these variables to have any value allowed by their type. You can specify one of these values:
none— The generatedmain()does not initialize global variables.public(default) — The generatedmain()initializes all global variables except for variables declared with astaticorconstkeyword.uninit— The generatedmain()initializes only global variables that are not initialized when they are declared.all— The generatedmain()initializes all global variables except for variables declared withconstkeyword.custom— The generatedmain()initializes the global variables that you specify with the propertyMainGeneratorWritesVariablesValues
See also Variables to initialize (-main-generator-writes-variables) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.MainGeneratorWritesVariables="uninit"
If you set the property MainGeneratorWritesVariablesValues to custom, use this property to specify the custom list of global variables that the generated main() initializes.
To modify this property, use these methods:
append(— Add a value to this property.value)pop(— Remove the value with indexvalueIdx)valueIdx. If you do not specify an index, the last item in the list is removed.clear()— Remove all values associated with this property.
Example: staticConf.CodeProverVerification.MainGeneratorWritesVariablesValues.append("globVar")
Example: staticConf.CodeProverVerification.MainGeneratorWritesVariablesValues.pop(0)
Specify that Polyspace does not check whether each class constructor initializes all class members.
See also Skip member initialization check (-no-constructors-init-check) (Polyspace Bug Finder).
Example: staticConf.CodeProverVerification.NoConstructorsInitCheck=True
Use these properties to modify the precision of the Code Prover verification. A more precise verification results in fewer orange checks. These checks indicate code where the verification cannot prove the presence or absence of an error.
| Property | Behavior |
|---|---|
ContextSensitivity | Specify the functions for which Polyspace stores the call context information. If a function is called multiple times, you can use this information to identify the function call that caused an error. The available values are:
that a Code Prover verification allows left shift operations on negative numbers. By default, this property is set to Example:
See also |
ContextSensitivityValues | If you set See also To modify this property, use these methods:
Example:
Example:
|
ModulesPrecision | Specify the path of source files whose code you want to verify at a higher precision level than the rest of the verification. To modify this property, use these methods:
Example:
Example:
See also |
PathSensitivityDelta | Specify that Polyspace uses fewer approximations when verifying code with fewer lines (less than 1000 lines of code. By default, this property is set to 0, which corresponds to off. To enable the property, specify a positive integer. Larger integers results in more precision but also longer verification times. Example:
See also |
PrecisionLevel | Specify a precision level for the verification. A higher precision produces fewer orange checks but results in a longer verification time. You can assign one of these precision levels, where each level corresponds to a different verification algorithm:
Example:
See also |
To | Specify the number of times the verification process runs on your code. Each additional run can lead to a greater number of proven results but also a longer verification time. You can assign one of these values:
See also Example:
|
Use these properties to perform a deeper or more superficial analysis of specific code constructs. Changing these properties can significantly affect verification time.
| Property | Behavior |
|---|---|
EnableKLimiting | Enable limiting the depth of the analysis for nested structures. By default, this property is set to Example:
See also |
KLimiting | Specify the depth of the analysis for nested structures. Use this property if you set the property By default, this property is set to 0 which corresponds to no verification of structures inside other structures. Specify a positive integer that corresponds to the depth of analysis for nested structures. A number less than 2 can result in a less precise verification. Example:
See also |
Inline | Specify the functions that Polyspace clones internally for each function call. The cloning can help reduce the complexity of the code. To modify this property, use these methods:
Example:
Example:
See also |
Specify that Polyspace runs a less extensive analysis that computes only the global variables sharing and usage in your entire application.
See also Show global variable sharing and usage only (-shared-variables-mode) (Polyspace Code Prover).
Example: staticConf.CodeProverVerification.SharedVariablesMode=True
Specify that Polyspace verifies each source file individually and independently from other source files in your application.
See also Verify files independently (-unit-by-unit) (Polyspace Code Prover).
Example: staticConf.CodeProverVerification.UnitByUnit=True
Specify the files that Polyspace includes with each file when running a file-by-file verification. The files that you specify are compiled once and then linked to each file verification.
To modify this property, use these methods:
append(— Add a file to this property.filePath)pop(— Remove the file with indexfilePathIdx)filePathIdx. If you do not specify an index, the last file in the list is removed.clear()— Remove all files associated with this property.
See also Common source files (-unit-by-unit-common-source) (Polyspace Code Prover).
Example: staticConf.CodeProverVerification.UnitByUnitCommonSource.append("/path/to/file.c")
Example: staticConf.CodeProverVerification.UnitByUnitCommonSource.pop(0)
Specify global assumptions that Polyspace makes about specific code constructs during the analysis.
| Property | Behavior |
|---|---|
ConsiderVolatileQualifierOnFields | Specify that a Code Prover verification takes into account the Example:
See also |
FloatRoundingMode | Specify the rounding mode Polyspace uses to determine the results of floating-point arithmetic operations. Specify one of these values:
See also Example:
|
IgnoreAssemblyCode | Specify that assembly instructions in C/C++ code cannot modify C/C++ variables. By default, this property is set to Example:
See also |
UnconstrainedPointersMayBeNull | Specify that environment pointers, which are pointers that can be assigned values outside your code, can have a Example:
See also |
Specify a time out limit in hours beyond which the analysis stops if it does not complete. Use this option to modify the default time out limit for an analysis. A Code Prover analysis times out if an internal step in the analysis lasts more than 24 hours. Use decimals to specify fractions of an hour.
See also Verification time limit (-timeout) (Polyspace Code Prover).
Example: staticConf.ComputingSettings.Timeout="5.75"
Specify that DOS or Windows® files are provided for analysis. Enable this property to help resolve case sensitivity and control character issues.
See also Code from DOS or Windows file system (-dos) (Polyspace Bug Finder).
Example: staticConf.EnvironmentSettings.Dos=True
Specify the path of an executable file or script that Polyspace runs on each source file after the preprocessing phase of the analysis. Use a post processing command to work around compilation errors or imprecisions in the analysis without modifying your source code.
See also Command/script to apply to preprocessed files (-post-preprocessing-command) (Polyspace Bug Finder).
Example: staticConf.EnvironmentSettings.PostPreprocessingCommand="/path/to/script.sh
Specify that the analysis stops if there are any compilation errors.
See also Stop analysis if a file does not compile (-stop-if-compile-error) (Polyspace Bug Finder).
Example: staticConf.EnvironmentSettings.StopIfCompileError=True
Specify the path of an XML file where you specify constraints on the value of global variables, functions inputs, and the return values of stubbed functions.
For more information on creating and editing the XML file, see Constraint setup (-data-range-specifications) (Polyspace Bug Finder).
Example: staticConf.InputsStubbing.DataRangeSpecifications="/path/to/constraints.xml"
Specify the name of functions that Polyspace stubs during an analysis. Polyspace ignores the definition of a stubbed function and assumes the function inputs and outputs have full range of values allowed by their type.
To modify this property, use these methods:
append(— Add a function to this property.functionName)pop(— Remove the file with indexfunctionNameIdx)functionNameIdx. If you do not specify an index, the last function in the list is removed.clear()— Remove all functions associated with this property.
See also Functions to stub (-functions-to-stub) (Polyspace Bug Finder).
Example: staticConf.InputsStubbing.FunctionsToStub.append("myFunc()")
Example: staticConf.InputsStubbing.FunctionsToStub.pop(0)
Specify the library that you use in your program. Polyspace uses smart stubs for functions from those libraries instead of generic stubs and does not attempt to check the function implementations. You can specify one of these libraries:
none— The analysis uses smart stubs only for functions from the C Standard Library.autosar— The analysis uses smart stubs for AUTOSAR RTE API functions even if their implementations are available.stdlibcxx— The analysis uses smart stubs for methods from C++ Standard Library containers even if their implementations are available.
See also Libraries used (-library) (Polyspace Bug Finder).
Example: staticConf.InputsStubbing.Library="autosar"
Specify that the analysis considers global and static variables as uninitialized unless those variables are explicitly initialized in the code.
See also Ignore default initialization of global variables (-no-def-init-glob) (Polyspace Bug Finder).
Example: staticConf.InputsStubbing.NoDefInitGlob=True
Configure Polyspace to identify certain families of multitasking functions, or use the relevant Multitasking properties to explicitly specify the entry points, cyclic tasks, interrupts, and protection mechanisms for shared variables in your code.
Specify the path of the ARXML file that Polyspace parses to setup the multitasking configuration for your AUTOSAR project.
Polyspace parses the ARXML files that you provide for OsTask, OsIsr, OsResource, OsAlarm, and OsEvent definitions. The analysis uses these definitions and the supported multitasking keywords to configure tasks, interrupts, cyclical tasks, and critical sections.
To modify this property, use these methods:
append(— Add a value to this property.ARXMLPath)pop(— Remove the value with indexARXMLPathIdx)ARXMLPathIdx. If you do not specify an index, the last value in the list is removed.clear()— Remove all values associated with this property.
See also ARXML files selection (-autosar-multitasking) (Polyspace Bug Finder).
Example: staticConf.Multitasking.AutosarMultitasking.append("/path/to/autosar.arxml")
Example: staticConf.Multitasking.AutosarMultitasking.pop(0)
Use a polyspace.project.CriticalSection object to specify the functions that begin and end a critical section in your code.
For example, if your code has a critical section that begins with the function myLock and ends with the function myUnlock, create a critical section object and then append it to the CriticalSections property to define the critical section.
# Define critical section object cs = polyspace.project.CriticalSection # Declare functions that begin and end the critical section and append the # critical section object to the CriticalSections property staticConf.Multitasking.CriticalSections.append(cs(Begin="myLock",End="myUnLock"))
To modify this property, use these methods:
append(— Add acriticalSectionObject)polyspace.project.CriticalSectionobject to this property.pop(— Remove thecriticalSectionObjectIdx)polyspace.project.CriticalSectionobject with indexcriticalSectionObjectIdx. If you do not specify an index, the lastpolyspace.project.CriticalSectionobject in the list is removed.Display the available critical sections (
staticConf.Multitaksing.CriticalSectionsto obtain the index of the critical section that you want to remove.clear()— Remove allpolyspace.project.CriticalSectionobjects associated with this property.
See also Critical section details (-critical-section-begin -critical-section-end) (Polyspace Bug Finder).
Specify the name of the functions that correspond to cyclic tasks in your code.
To modify this property, use these methods:
append(— Add a function to this property.functionName)pop(— Remove the function with indexfunctionNameIdx)functionNameIdx. If you do not specify an index, the last function in the list is removed.clear()— Remove all functions associated with this property.
See also Cyclic tasks (-cyclic-tasks) (Polyspace Bug Finder).
Example: staticConf.Multitasking.CyclicTasks.append("funcIsCyclicTask")
Example: staticConf.Multitasking.CyclicTasks.pop(0)
Specify that Polyspace generates a report after the analysis completes.
See also Generate report (Polyspace Bug Finder).
Example: staticConf.Reporting.EnableReportGeneration=True
Specify the format of the generated report. Polyspace can generate and save a report to one of these file formats: HTML, PDF, or WORD.
See also Output format (-report-output-format) (Polyspace Bug Finder).
Example: staticConf.Reporting.ReportOutputFormat="PDF"
Specify the name of the report template you use to generate a report for Bug Finder analysis results.
For a description of the content of each report template, see Bug Finder and Code Prover report (-report-template) (Polyspace Bug Finder).
To use this property, set EnableReportGeneration to True.
Example: staticConf.Reporting.ReportTemplateBugFinder="CodingStandards"
Specify the name of the report template you use to generate a report for Code Prover analysis results.
For a description of the content of each report template, see Bug Finder and Code Prover report (-report-template) (Polyspace Bug Finder).
To use this property, set EnableReportGeneration to True.
Example: staticConf.Reporting.ReportTemplateCodeProver="DeveloperReview"
Methods
export() | Example:
|
Version History
Introduced in R2024aIn R2026a, the polyspace.project.StaticAnalysisConfig class was
renamed polyspace.project.OwnedStaticAnalysisConfiguration.
Use the
polyspace.project.OwnedStaticAnalysisConfigurationclass to edit static analysis configurations owned by the project and saved in the.psprjxfile.Use the
polyspace.project.StaticAnalysisConfigurationclass to edit static analysis configurations saved in a.pscfgfile. To manage references from a project to a.pscfgfile containing a static analysis configuration, use thepolyspace.project.StaticAnalysisConfigurationRefclass.
Impact analysis is removed. Attempting to use these options results in an error:
ImpactAnalysisImpactAnalysisOnlyImpactSpecifications
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)