Method display
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function display()
{
\javascript('jquery');
\javascript('jquery_ui');
- Create a ticketCreate a ticket
The method display() has 136 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function display()
{
\javascript('jquery');
\javascript('jquery_ui');
- Create a ticketCreate a ticket
- Exclude checks
Missing class import via use statement (line '50', column '21'). Open
$form = new \PHPWS_Form('internship');
- 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 '\Intern\AssetResolver' in method 'display'. Open
$tpl['entry_bundle'] = AssetResolver::resolveJsPath('assets.json', 'searchInterface');
- 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\SubHostFactory' in method 'display'. Open
$hosts = SubHostFactory::getHostAssoc();
- 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\WorkflowStateFactory' in method 'display'. Open
$workflowStates = WorkflowStateFactory::getStatesAssoc();
- 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\TermFactory' in method 'display'. Open
$terms = TermFactory::getTermsAssoc();
- 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\Subject' in method 'display'. Open
$subjects = array('-1' => 'Select subject ') + Subject::getSubjects();
- 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
The method display uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
}else{
$depts = DepartmentFactory::getDepartmentsAssocForUsername(\Current_User::getUsername());
}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Intern\DepartmentFactory' in method 'display'. Open
$depts = DepartmentFactory::getDepartmentsAssocForUsername(\Current_User::getUsername());
- 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 '\Current_User' in method 'display'. Open
$depts = DepartmentFactory::getDepartmentsAssocForUsername(\Current_User::getUsername());
- 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
return \PHPWS_Template::process($form->getTemplate(), 'intern', 'search.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 '\Current_User' in method 'display'. Open
if(\Current_User::isDeity()){
- 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\DepartmentFactory' in method 'display'. Open
$depts = DepartmentFactory::getDepartmentsAssoc();
- 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['major_bundle'] = AssetResolver::resolveJsPath('assets.json', 'majorSelector');
- 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 setMethod
from undeclared class \PHPWS_Form
Open
$form->setMethod('get');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addSelect
from undeclared class \PHPWS_Form
Open
$form->addSelect('course_subj', $subjects);
- Create a ticketCreate a ticket
- Exclude checks
Call to method addCssClass
from undeclared class \PHPWS_Form
Open
$form->addCssClass('start_date', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('name', "Name or Banner ID");
- Create a ticketCreate a ticket
- Exclude checks
Call to method setClass
from undeclared class \PHPWS_Form
Open
$form->setClass('course_no', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setSize
from undeclared class \PHPWS_Form
Open
$form->setSize('course_sect', 6);
- Create a ticketCreate a ticket
- Exclude checks
Call to method addCheckAssoc
from undeclared class \PHPWS_Form
Open
$form->addCheckAssoc('workflow_state', $workflowStates);
- Create a ticketCreate a ticket
- Exclude checks
Call to method addHidden
from undeclared class \PHPWS_Form
Open
$form->addHidden('faculty_id');
- Create a ticketCreate a ticket
- Exclude checks
Possibly zero references to use statement for classlike/namespace Internship
(\Intern\Internship)
Open
use Intern\Internship;
- Create a ticketCreate a ticket
- Exclude checks
Call to method addHidden
from undeclared class \PHPWS_Form
Open
$form->addHidden('action', 'results');
- Create a ticketCreate a ticket
- Exclude checks
Call to method isDeity
from undeclared class \Current_User
Open
if(\Current_User::isDeity()){
- Create a ticketCreate a ticket
- Exclude checks
Call to method addSelect
from undeclared class \PHPWS_Form
Open
$form->addSelect('host_select', array(-1 => 'All') + $hosts);
- Create a ticketCreate a ticket
- Exclude checks
Call to method addText
from undeclared class \PHPWS_Form
Open
$form->addText('start_date');
- Create a ticketCreate a ticket
- Exclude checks
Call to method useRowRepeat
from undeclared class \PHPWS_Form
Open
$form->useRowRepeat();
- Create a ticketCreate a ticket
- Exclude checks
Call to method addText
from undeclared class \PHPWS_Form
Open
$form->addText('course_no');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setSize
from undeclared class \PHPWS_Form
Open
$form->setSize('course_no', 6);
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('department', 'Department');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addSubmit
from undeclared class \PHPWS_Form
Open
$form->addSubmit('submit', 'Search');
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \PHPWS_Form
Open
$form = new \PHPWS_Form('internship');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setClass
from undeclared class \PHPWS_Form
Open
$form->setClass('term_select', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addSelect
from undeclared class \PHPWS_Form
Open
$form->addSelect('department', $depts);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared function \javascriptMod()
Open
\javascriptMod('intern', 'formGoodies');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('start_date', 'Starting After');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addText
from undeclared class \PHPWS_Form
Open
$form->addText('end_date');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('end_date', 'Ending Before');
- 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 addSelect
from undeclared class \PHPWS_Form
Open
$form->addSelect('term_select', array(-1 => 'All') + $terms);
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared function \javascript()
Open
\javascript('jquery');
- Create a ticketCreate a ticket
- Exclude checks
Call to undeclared function \javascript()
Open
\javascript('jquery_ui');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('course_subj', 'Subject');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('term_select', 'Term');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('course_no', 'Course Number');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('host_select', 'Host');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setClass
from undeclared class \PHPWS_Form
Open
$form->setClass('host_select', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method getTemplate
from undeclared class \PHPWS_Form
Open
return \PHPWS_Template::process($form->getTemplate(), 'intern', 'search.tpl');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setClass
from undeclared class \PHPWS_Form
Open
$form->setClass('course_subj', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addText
from undeclared class \PHPWS_Form
Open
$form->addText('course_sect');
- Create a ticketCreate a ticket
- Exclude checks
Call to method getUsername
from undeclared class \Current_User
Open
$depts = DepartmentFactory::getDepartmentsAssocForUsername(\Current_User::getUsername());
- Create a ticketCreate a ticket
- Exclude checks
Call to method addCssClass
from undeclared class \PHPWS_Form
Open
$form->addCssClass('faculty', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method process
from undeclared class \PHPWS_Template
Open
return \PHPWS_Template::process($form->getTemplate(), 'intern', 'search.tpl');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addHidden
from undeclared class \PHPWS_Form
Open
$form->addHidden('module', 'intern');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setMaxSize
from undeclared class \PHPWS_Form
Open
$form->setMaxSize('course_sect', 4);
- Create a ticketCreate a ticket
- Exclude checks
Call to method setClass
from undeclared class \PHPWS_Form
Open
$form->setClass('department', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setMatch
from undeclared class \PHPWS_Form
Open
$form->setMatch('department', $keys[1]);
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('faculty', 'Faculty Supervisor / Instructor of Record');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addText
from undeclared class \PHPWS_Form
Open
$form->addText('name');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setMaxSize
from undeclared class \PHPWS_Form
Open
$form->setMaxSize('course_no', 4);
- Create a ticketCreate a ticket
- Exclude checks
Call to method setExtra
from undeclared class \PHPWS_Form
Open
$form->setExtra('faculty', 'disabled');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setLabel
from undeclared class \PHPWS_Form
Open
$form->setLabel('course_sect', 'Section');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setClass
from undeclared class \PHPWS_Form
Open
$form->setClass('course_sect', 'form-control');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addSelect
from undeclared class \PHPWS_Form
Open
$form->addSelect('faculty', array(-1=>'Select Faculty Supervisor'));
- 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 undeclared function \javascriptMod()
Open
javascriptMod('intern', 'resetSearch');
- Create a ticketCreate a ticket
- Exclude checks