Missing class import via use statement (line '25', column '14'). Open
throw new \App\Exceptions\NoPermittedForAdmin('LBL_PERMISSION_DENIED');
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\App\YetiForce\Register' in method 'outlook'. Open
$ik = \App\YetiForce\Register::getInstanceKey();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\YetiForce\Shop' in method 'checkPermission'. Open
if(!\App\YetiForce\Shop::check('YetiForceOutlook')){
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid unused parameters such as '$request'. Open
public function outlook(App\Request $request)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Reference to static property site_URL
from undeclared class \Config\Main
Open
Config\Main::$site_URL,
- Exclude checks
Call to method getInstanceKey
from undeclared class \App\YetiForce\Register
Open
$ik = \App\YetiForce\Register::getInstanceKey();
- Exclude checks
Call to method check
from undeclared class \App\YetiForce\Shop
Open
if(!\App\YetiForce\Shop::check('YetiForceOutlook')){
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_MailIntegration_Download_Action extends Settings_Vtiger_Basic_Action
- Exclude checks
The class Settings_MailIntegration_Download_Action is not named in CamelCase. Open
class Settings_MailIntegration_Download_Action extends Settings_Vtiger_Basic_Action
{
/** {@inheritdoc} */
public function __construct()
{
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Avoid variables with short names like $ik. Configured minimum length is 3. Open
$ik = \App\YetiForce\Register::getInstanceKey();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Spaces must be used to indent lines; tabs are not allowed Open
'{__CRM_URL__}',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$request->validateReadAccess();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->exposeMethod('outlook');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
substr($ik, 0, 30),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], $body);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __construct()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::checkPermission($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$body = str_replace([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'{__ACCESS_TOKEN__}',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header('content-type: text/xml');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Config\Main::$site_URL,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo $body;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\NoPermittedForAdmin('LBL_PERMISSION_DENIED');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Generate outlook manifest.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ik = \App\YetiForce\Register::getInstanceKey();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$manifestPath = ROOT_DIRECTORY . '/modules/MailIntegration/installation/outlook.xml';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header('content-disposition: attachment; filename="outlook_manifest.xml";');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if(!\App\YetiForce\Shop::check('YetiForceOutlook')){
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split($ik, 4)),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$body = file_get_contents($manifestPath);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::__construct();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'{__CRM_GUID__}',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header('content-length: ' . \strlen($body));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function validateRequest(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function checkPermission(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function outlook(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], [
- Exclude checks
Class name "Settings_MailIntegration_Download_Action" is not in camel caps format Open
class Settings_MailIntegration_Download_Action extends Settings_Vtiger_Basic_Action
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
if(!\App\YetiForce\Shop::check('YetiForceOutlook')){
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if(!\App\YetiForce\Shop::check('YetiForceOutlook')){
- Exclude checks