Performs code analysis on native COBOL code.


Attribute Description Required
analysisDataDir 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.

Parameters specified as nested elements


Use nested <ruleList> elements to specify the rules for which a code analysis will be executed. See ruleList.


Use nested <mffilelist> elements to specify the source files for which a code analysis will be executed. See mffilelist.


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"/>

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

<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">

<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"/>

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

Copyright © 1984-2015 Micro Focus. All rights reserved.