analysis

Description

Performs code analysis on native COBOL code.

Parameters

Attribute Description Required
dir Specify the directory that will store the data to be analyzed. This directory should be the same one defined in the cobol task. Yes
failOnError When set to true, the code analysis results are treated as errors. Any subsequent Ant tasks are not executed and the build is marked as failed. When set to false, the code analysis results are treated as warnings. The build continues with the execution of the next Ant tasks. The default value is false. Yes

Parameters specified as nested elements

ruleList
Use nested <ruleList> elements to specify the rules for which a code analysis will be executed. See ruleList.
fileset
Use nested <fileset> elements to specify the source file name(s) to be compiled.
mffilelist
Use nested <mffilelist> elements to specify the source files for which a code analysis will be executed. See mffilelist.

Examples

Running code analysis on the output produced by the cobol task:

<mfdirlist id="cobol.default.directives">
    <directive name="dialect" value="MF"/>
    <directive name="charset" value="ASCII"/>
</mfdirlist>

<mffilelist id="source.files" srcdir="${basedir}" type="srcfile">
    <file name="Program1.cbl"/>
    <file name="Program2.cbl"/>
    <file name="Program3.cbl"/>
</mffilelist>

<ruleList id="rules1">
   <rule xmlFilePath="${rulesDir}\GeneralRules.xml" name="Choosing Efficient Computational Data Items - Declarations" language="COBOL" ruleSet="Cobol Performance">
   <rule xmlFilePath="${rulesDir}\GeneralRules.xml" name="Operations with Different Decimal Precision - Conditions" language="COBOL" ruleSet="Cobol Performance">
</ruleList>

<cobol srcfile="Program.cbl" srcdir="${basedir}" desttype="obj" destdir="${basedir}/bin" is64bit="true" analysisDataDir="${analysisDataDir}" analysisData="standalone">
    <mfdirlist refid="cobol.default.directives"/>
    <mffilelist refid="source.files"/>
</cobol>

<analysis dir="${analysisDataDir}">
    <mffilelist refid="source.files"/>
    <ruleList refid="rules1"/>
</cobol>