import { SFDXCommand } from "../command/SFDXCommand" ; import SFPLogger , { Logger , LoggerLevel } from "../logger/SFPLogger" ; export default class AnalyzeWithPMDImpl extends SFDXCommand { public constructor ( protected sourceDirectory , private rulesets , private format , private ouputPath , private version , protected logger ? , protected logLevel ? ) { super ( null , null , logger , logLevel ) ; } getSFDXCommand ( ) { return "sfdx sfpowerkit:source:pmd" ; } getCommandName ( ) { return "PMD Analysis" ; } getGeneratedParams ( ) { let command = "" ; if ( this . sourceDirectory ) command = `-d  ${ this . sourceDirectory }` ; if ( this . format ) command += ` -f  ${ this . format }` ; if ( this . ouputPath ) command += ` -o  ${ this . ouputPath }` ; if ( this . rulesets ) command += ` -R  ${ this . rulesets }` ; if ( this . version ) command += ` --version  ${ this . version }` ; command += ` --no-failonviolation` ; command += ` --loglevel ${ LoggerLevel [ SFPLogger . logLevel ] }` ; return command ; } }