Method indexAction
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function indexAction()
{
$this->view->feeds = $this->Feed->getGlobalFeeds($this->userSession->Dao);
$this->view->loggedUser = $this->userSession->Dao;
$this->view->itemThumbnails = $this->Item->getRandomThumbnails($this->userSession->Dao, 0, 12, true);
- Create a ticketCreate a ticket
Missing class import via use statement (line '57', column '25'). Open
$date = new DateTime();
- 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
Missing class import via use statement (line '84', column '23'). Open
throw new Zend_Exception('Please set the feed Id');
- 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
Missing class import via use statement (line '58', column '29'). Open
$interval = new DateInterval('P1M');
- 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 'UtilityComponent' in method 'indexAction'. Open
UtilityComponent::setCookie($request, $cookieName, $date->getTimestamp(), $expires);
- 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
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class FeedController extends AppController
- Create a ticketCreate a ticket
- Exclude checks
The property $_models is not named in camelCase. Open
class FeedController extends AppController
{
public $_models = array('Feed', 'Item', 'User', 'Community');
public $_daos = array();
public $_components = array();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_components is not named in camelCase. Open
class FeedController extends AppController
{
public $_models = array('Feed', 'Item', 'User', 'Community');
public $_daos = array();
public $_components = array();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_daos is not named in camelCase. Open
class FeedController extends AppController
{
public $_models = array('Feed', 'Item', 'User', 'Community');
public $_daos = array();
public $_components = array();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Property name "$_components" should not be prefixed with an underscore to indicate visibility Open
public $_components = array();
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_daos" should not be prefixed with an underscore to indicate visibility Open
public $_daos = array();
- Create a ticketCreate a ticket
- Exclude checks
Property name "$_models" should not be prefixed with an underscore to indicate visibility Open
public $_models = array('Feed', 'Item', 'User', 'Community');
- Create a ticketCreate a ticket
- Exclude checks