Missing class import via use statement (line '40', column '14'). Open
throw new \App\Exceptions\NoPermitted('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
Missing class import via use statement (line '22', column '14'). Open
throw new \App\Exceptions\NoPermitted('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\Fields\File' in method 'get'. Open
$file = \App\Fields\File::loadFromInfo([
'path' => ROOT_DIRECTORY . DIRECTORY_SEPARATOR . $logo['path'],
'name' => $logo['name'],
]);
- 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\User' in method 'get'. Open
$userModel = \App\User::getUserModel($request->getInteger('record'));
- 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\Session' in method 'getCheckPermission'. Open
if (!App\Session::has('authenticated_user_id') || $request->isEmpty('record', true) || $request->isEmpty('key', true)) {
- 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
Call to method getUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userModel = \App\User::getUserModel($request->getInteger('record'));
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class MultiCompany_Logo_File extends Vtiger_Basic_File
- Exclude checks
The class MultiCompany_Logo_File is not named in CamelCase. Open
class MultiCompany_Logo_File extends Vtiger_Basic_File
{
/** {@inheritdoc} */
public $storageName = 'MultiCompany';
- 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
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\NoPermitted
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function get(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => $logo['name'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header('pragma: public');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!App\Session::has('authenticated_user_id') || $request->isEmpty('record', true) || $request->isEmpty('key', true)) {
- 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
throw new \App\Exceptions\NoPermitted('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
$userModel = \App\User::getUserModel($request->getInteger('record'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header('content-length: ' . $file->getSize());
- 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 getCheckPermission(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = \App\Fields\File::loadFromInfo([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header('content-transfer-encoding: binary');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $storageName = 'MultiCompany';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get company logo.
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header('content-type: ' . $file->getMimeType());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'path' => ROOT_DIRECTORY . DIRECTORY_SEPARATOR . $logo['path'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
readfile($file->getPath());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\IllegalValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\NoPermitted('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
]);
- 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
header('cache-control: max-age=86400, public');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
header('expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 86400));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
if (!App\Session::has('authenticated_user_id') || $request->isEmpty('record', true) || $request->isEmpty('key', true)) {
- 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
return true;
- 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
$logo = $userModel->get('multiCompanyLogo');
- 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
if (!$logo || ($logo['key'] !== $request->getByType('key', 2))) {
- Exclude checks
Class name "MultiCompany_Logo_File" is not in camel caps format Open
class MultiCompany_Logo_File extends Vtiger_Basic_File
- Exclude checks