display accesses the super-global variable $_GET. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
display accesses the super-global variable $_REQUEST. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
display accesses the super-global variable $_REQUEST. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
display accesses the super-global variable $_REQUEST. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Method display
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Create a ticketCreate a ticket
Missing class import via use statement (line '53', column '21'). Open
$form = new \PHPWS_Form('edit_affil');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Current_User' in method 'display'. Open
if(!\Current_User::allow('intern', 'affiliation_agreement')){
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Intern\AssetResolver' in method 'display'. Open
$tpl['vendor_bundle'] = AssetResolver::resolveJsPath('assets.json', 'vendor');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Intern\AssetResolver' in method 'display'. Open
$tpl['department_bundle'] = AssetResolver::resolveJsPath('assets.json', 'affiliationDepartments');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Intern\AffiliationAgreementFactory' in method 'display'. Open
$affiliate_agreement = AffiliationAgreementFactory::getAffiliationById($aaId);
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\NQ' in method 'display'. Open
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Intern\AssetResolver' in method 'display'. Open
$tpl['location_bundle'] = AssetResolver::resolveJsPath('assets.json', 'affiliationLocation');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Intern\AssetResolver' in method 'display'. Open
$tpl['terminate_bundle'] = AssetResolver::resolveJsPath('assets.json', 'affiliationTerminate');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\PHPWS_Template' in method 'display'. Open
$v = \PHPWS_Template::process($form->getTemplate(), 'intern', 'editAffiliate.tpl');
- Read upRead up
- Create a ticketCreate a ticket
- 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 '\Intern\AssetResolver' in method 'display'. Open
$tpl['uploadAffil_bundle'] = AssetResolver::resolveJsPath('assets.json', 'affiliationUpload');
- Read upRead up
- Create a ticketCreate a ticket
- 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 addCssClass
from undeclared class \PHPWS_Form
Open
$form->addCssClass('name', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setAction
from undeclared class \PHPWS_Form
Open
$form->setAction('index.php?module=intern&action=saveAffiliate&affiliation_agreement_id='.$aaId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method addText
from undeclared class \PHPWS_Form
Open
$form->addText('begin_date', date('m/d/Y', $affiliate_agreement->getBeginDate()));
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('name', 'Affiliate Name');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addCssClass
from undeclared class \PHPWS_Form
Open
$form->addCssClass('end_date', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method getTemplate
from undeclared class \PHPWS_Form
Open
$v = \PHPWS_Template::process($form->getTemplate(), 'intern', 'editAffiliate.tpl');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('auto_renew', 'Auto-Renew');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('end_date', 'Ending Date');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addCssClass
from undeclared class \PHPWS_Form
Open
$form->addCssClass('notes', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addText
from undeclared class \PHPWS_Form
Open
$form->addText('name', $affiliate_agreement->getName());
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('begin_date', 'Beginning Date');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('notes', 'Notes');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setMatch
from undeclared class \PHPWS_Form
Open
$form->setMatch('auto_renew', 'yes');
- Create a ticketCreate a ticket
- Exclude checks
Argument 1 (id)
is string|string[]
but \Intern\AffiliationAgreementFactory::getAffiliationById()
takes int
defined at /code/class/AffiliationAgreementFactory.php:35
Open
$affiliate_agreement = AffiliationAgreementFactory::getAffiliationById($aaId);
- Create a ticketCreate a ticket
- Exclude checks
Call to method plugIn
from undeclared class \PHPWS_Form
Open
$form->plugIn($_GET);
- Create a ticketCreate a ticket
- Exclude checks
Call to method addText
from undeclared class \PHPWS_Form
Open
$form->addText('end_date', date('m/d/Y',$affiliate_agreement->getEndDate()));
- Create a ticketCreate a ticket
- Exclude checks
Call to method simple
from undeclared class \NQ
Open
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Create a ticketCreate a ticket
- Exclude checks
Call to method process
from undeclared class \PHPWS_Template
Open
$v = \PHPWS_Template::process($form->getTemplate(), 'intern', 'editAffiliate.tpl');
- Create a ticketCreate a ticket
- Exclude checks
Call to method allow
from undeclared class \Current_User
Open
if(!\Current_User::allow('intern', 'affiliation_agreement')){
- Create a ticketCreate a ticket
- Exclude checks
Call to method addCheck
from undeclared class \PHPWS_Form
Open
$form->addCheck('auto_renew', 'yes');
- Create a ticketCreate a ticket
- Exclude checks
Call to method mergeTemplate
from undeclared class \PHPWS_Form
Open
$form->mergeTemplate($tpl);
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \PHPWS_Form
Open
$form = new \PHPWS_Form('edit_affil');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addCssClass
from undeclared class \PHPWS_Form
Open
$form->addCssClass('begin_date', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addTextArea
from undeclared class \PHPWS_Form
Open
$form->addTextArea('notes', $affiliate_agreement->getNotes());
- Create a ticketCreate a ticket
- Exclude checks
Avoid variables with short names like $v. Configured minimum length is 3. Open
$v = \PHPWS_Template::process($form->getTemplate(), 'intern', 'editAffiliate.tpl');
- Read upRead up
- Create a ticketCreate a ticket
- 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
The variable $affiliate_agreement is not named in camelCase. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $affiliate_agreement is not named in camelCase. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $affiliate_agreement is not named in camelCase. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $affiliate_agreement is not named in camelCase. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $affiliate_agreement is not named in camelCase. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $affiliate_agreement is not named in camelCase. Open
public function display()
{
/* Check if user should have access to Affiliate Agreement page */
if(!\Current_User::allow('intern', 'affiliation_agreement')){
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}