Taken from the documentation. First hit after doing a Google search for disable parts of a file codesniffer php
Ignoring parts of a file using comments
$xmlPackage = new XMLPackage;
// @codingStandardsIgnoreStart
$xmlPackage['error_code'] = get_default_error_code_value();
// @codingStandardsIgnoreEnd
$xmlPackage->send();
http://pear.php.net/manual/en/package.php.php-codesniffer.advanced-usage.php
Is this what you mean?
As for PHP-MD...
http://phpmd.org/documentation/suppress-warnings.html
Two clicks from
I'm not normally the kind to say this, but it would be much quicker for you if you read the documentation (which it seems you did, as I edited this answer!)