midasplatform/Midas

View on GitHub
core/controllers/FeedController.php

Summary

Maintainability
A
1 hr
Test Coverage

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);
Severity: Minor
Found in core/controllers/FeedController.php - About 1 hr to fix

Missing class import via use statement (line '57', column '25').
Open

            $date = new DateTime();
Severity: Minor
Found in core/controllers/FeedController.php by phpmd

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');
Severity: Minor
Found in core/controllers/FeedController.php by phpmd

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');
Severity: Minor
Found in core/controllers/FeedController.php by phpmd

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);
Severity: Minor
Found in core/controllers/FeedController.php by phpmd

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

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();
Severity: Minor
Found in core/controllers/FeedController.php by phpmd

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();
Severity: Minor
Found in core/controllers/FeedController.php by phpmd

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();
Severity: Minor
Found in core/controllers/FeedController.php by phpmd

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();

Property name "$_daos" should not be prefixed with an underscore to indicate visibility
Open

    public $_daos = array();

Property name "$_models" should not be prefixed with an underscore to indicate visibility
Open

    public $_models = array('Feed', 'Item', 'User', 'Community');

There are no issues that match your filters.

Category
Status