midasplatform/Midas

View on GitHub
core/controllers/ItemController.php

Summary

Maintainability
F
5 days
Test Coverage

Function viewAction has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
Open

    public function viewAction()
    {
        if (!($this->_request->isGet() || $this->_request->isPost())) {
            throw new Zend_Exception('Only HTTP Get or Post requests are accepted', 400);
        }
Severity: Minor
Found in core/controllers/ItemController.php - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File ItemController.php has 523 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*=========================================================================
 Midas Server
 Copyright Kitware SAS, 26 rue Louis Guérin, 69100 Villeurbanne, France.
 All rights reserved.
Severity: Major
Found in core/controllers/ItemController.php - About 1 day to fix

Method viewAction has 195 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function viewAction()
    {
        if (!($this->_request->isGet() || $this->_request->isPost())) {
            throw new Zend_Exception('Only HTTP Get or Post requests are accepted', 400);
        }
Severity: Major
Found in core/controllers/ItemController.php - About 7 hrs to fix

The class ItemController has an overall complexity of 126 which is very high. The configured complexity threshold is 50.
Open

class ItemController extends AppController
{
    public $_models = array('Item', 'ItemRevision', 'Bitstream', 'Folder', 'Metadata', 'License', 'Progress');
    public $_daos = array();
    public $_components = array('Breadcrumb', 'Date', 'Sortdao');
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

The class ItemController has 11 public methods. Consider refactoring ItemController to keep number of public methods under 10.
Open

class ItemController extends AppController
{
    public $_models = array('Item', 'ItemRevision', 'Bitstream', 'Folder', 'Metadata', 'License', 'Progress');
    public $_daos = array();
    public $_components = array('Breadcrumb', 'Date', 'Sortdao');
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

Function editAction has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Minor
Found in core/controllers/ItemController.php - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method editAction has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Major
Found in core/controllers/ItemController.php - About 2 hrs to fix

Method editmetadataAction has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function editmetadataAction()
    {
        $this->disableLayout();
        if (!$this->logged) {
            throw new Zend_Exception(MIDAS_LOGIN_REQUIRED);
Severity: Major
Found in core/controllers/ItemController.php - About 2 hrs to fix

Function editmetadataAction has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function editmetadataAction()
    {
        $this->disableLayout();
        if (!$this->logged) {
            throw new Zend_Exception(MIDAS_LOGIN_REQUIRED);
Severity: Minor
Found in core/controllers/ItemController.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getmetadatavalueexistsAction has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getmetadatavalueexistsAction()
    {
        $this->disableLayout();
        $this->disableView();
        $itemId = $this->getParam('itemId');
Severity: Minor
Found in core/controllers/ItemController.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method getmetadatavalueexistsAction has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getmetadatavalueexistsAction()
    {
        $this->disableLayout();
        $this->disableView();
        $itemId = $this->getParam('itemId');
Severity: Minor
Found in core/controllers/ItemController.php - About 1 hr to fix

Method editbitstreamAction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function editbitstreamAction()
    {
        $this->disableLayout();
        // load item and check permissions
        $bitstreamId = $this->getParam('bitstreamId');
Severity: Minor
Found in core/controllers/ItemController.php - About 1 hr to fix

Function editbitstreamAction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function editbitstreamAction()
    {
        $this->disableLayout();
        // load item and check permissions
        $bitstreamId = $this->getParam('bitstreamId');
Severity: Minor
Found in core/controllers/ItemController.php - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function deletebitstreamAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function deletebitstreamAction()
    {
        $this->disableLayout();
        $this->disableView();
        // load item and check permissions
Severity: Minor
Found in core/controllers/ItemController.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function mergeAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function mergeAction()
    {
        $this->disableLayout();
        $this->disableView();

Severity: Minor
Found in core/controllers/ItemController.php - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

The method editmetadataAction() has an NPath complexity of 576. The configured NPath complexity threshold is 200.
Open

    public function editmetadataAction()
    {
        $this->disableLayout();
        if (!$this->logged) {
            throw new Zend_Exception(MIDAS_LOGIN_REQUIRED);
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method viewAction() has 227 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function viewAction()
    {
        if (!($this->_request->isGet() || $this->_request->isPost())) {
            throw new Zend_Exception('Only HTTP Get or Post requests are accepted', 400);
        }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

The method editAction() has an NPath complexity of 396. The configured NPath complexity threshold is 200.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Minor
Found in core/controllers/ItemController.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method viewAction() has an NPath complexity of 1688947200. The configured NPath complexity threshold is 200.
Open

    public function viewAction()
    {
        if (!($this->_request->isGet() || $this->_request->isPost())) {
            throw new Zend_Exception('Only HTTP Get or Post requests are accepted', 400);
        }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method editAction() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Minor
Found in core/controllers/ItemController.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

The method editmetadataAction() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
Open

    public function editmetadataAction()
    {
        $this->disableLayout();
        if (!$this->logged) {
            throw new Zend_Exception(MIDAS_LOGIN_REQUIRED);
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

The method viewAction() has a Cyclomatic Complexity of 50. The configured cyclomatic complexity threshold is 10.
Open

    public function viewAction()
    {
        if (!($this->_request->isGet() || $this->_request->isPost())) {
            throw new Zend_Exception('Only HTTP Get or Post requests are accepted', 400);
        }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

Missing class import via use statement (line '499', column '23').
Open

            throw new Zend_Exception("This item doesn't exist or you don't have the permissions.");
Severity: Minor
Found in core/controllers/ItemController.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 '116', column '23').
Open

            throw new Zend_Exception('Only HTTP Get or Post requests are accepted', 400);
Severity: Minor
Found in core/controllers/ItemController.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 '672', column '23').
Open

            throw new Zend_Exception('Invalid itemId', 404);
Severity: Minor
Found in core/controllers/ItemController.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 '466', column '23').
Open

            throw new Zend_Exception('itemrevisionId should be a number');
Severity: Minor
Found in core/controllers/ItemController.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 '161', column '31').
Open

                    throw new Zend_Exception('Must specify an element parameter');
Severity: Minor
Found in core/controllers/ItemController.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 '432', column '23').
Open

            throw new Zend_Exception("This item doesn't exist or you don't have the permissions.");
Severity: Minor
Found in core/controllers/ItemController.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 '124', column '23').
Open

            throw new Zend_Exception('Must specify an itemId parameter');
Severity: Minor
Found in core/controllers/ItemController.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 '455', column '23').
Open

            throw new Zend_Exception('itemId should be a number');
Severity: Minor
Found in core/controllers/ItemController.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 '490', column '23').
Open

            throw new Zend_Exception('bitstreamId should be a number');
Severity: Minor
Found in core/controllers/ItemController.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 '538', column '23').
Open

            throw new Zend_Exception("This bitstream doesn't exist.");
Severity: Minor
Found in core/controllers/ItemController.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 '675', column '23').
Open

            throw new Zend_Exception('Invalid policy', 403);
Severity: Minor
Found in core/controllers/ItemController.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 '56', column '23').
Open

            throw new Zend_Exception('Must specify a itemId parameter');
Severity: Minor
Found in core/controllers/ItemController.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 '69', column '23').
Open

            throw new Zend_Exception("This item doesn't exist.", 404);
Severity: Minor
Found in core/controllers/ItemController.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 '159', column '34').
Open

                $validator = new Zend_Validate_Digits();
Severity: Minor
Found in core/controllers/ItemController.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 '494', column '23').
Open

            throw new Zend_Exception("This bitstream doesn't exist.");
Severity: Minor
Found in core/controllers/ItemController.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 '132', column '23').
Open

            throw new Zend_Exception("This item doesn't exist.", 404);
Severity: Minor
Found in core/controllers/ItemController.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 '365', column '23').
Open

            throw new Zend_Exception('Permissions error.');
Severity: Minor
Found in core/controllers/ItemController.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 '460', column '23').
Open

            throw new Zend_Exception("This item doesn't exist or you don't have the permissions.");
Severity: Minor
Found in core/controllers/ItemController.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 '50', column '23').
Open

            throw new Zend_Exception(MIDAS_LOGIN_REQUIRED);
Severity: Minor
Found in core/controllers/ItemController.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 '136', column '23').
Open

            throw new Zend_Exception('Read permission required', 403);
Severity: Minor
Found in core/controllers/ItemController.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 '569', column '23').
Open

            throw new Zend_Exception('Please set a name');
Severity: Minor
Found in core/controllers/ItemController.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 '63', column '27').
Open

                throw new Zend_Exception('Must specify a metadataId parameter');
Severity: Minor
Found in core/controllers/ItemController.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 '427', column '23').
Open

            throw new Zend_Exception('itemId should be a number');
Severity: Minor
Found in core/controllers/ItemController.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 '54', column '26').
Open

        $validator = new Zend_Validate_Digits();
Severity: Minor
Found in core/controllers/ItemController.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 '150', column '27').
Open

                throw new Zend_Exception('The item must have at least one revision to have metadata', MIDAS_INVALID_POLICY);
Severity: Minor
Found in core/controllers/ItemController.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 '636', column '27').
Open

                throw new Zend_Exception("This item doesn't exist.", 404);
Severity: Minor
Found in core/controllers/ItemController.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 '668', column '23').
Open

            throw new Zend_Exception('Must pass an itemId parameter');
Severity: Minor
Found in core/controllers/ItemController.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 '73', column '23').
Open

            throw new Zend_Exception('Write permissions required', 403);
Severity: Minor
Found in core/controllers/ItemController.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 '122', column '26').
Open

        $validator = new Zend_Validate_Digits();
Severity: Minor
Found in core/controllers/ItemController.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 '221', column '29').
Open

            $interval = new DateInterval('P1M');
Severity: Minor
Found in core/controllers/ItemController.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 '362', column '23').
Open

            throw new Zend_Exception('The item doesn t exist.');
Severity: Minor
Found in core/controllers/ItemController.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 '220', column '25').
Open

            $date = new DateTime();
Severity: Minor
Found in core/controllers/ItemController.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 '470', column '23').
Open

            throw new Zend_Exception("This item revision doesn't exist.");
Severity: Minor
Found in core/controllers/ItemController.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('The item must have at least one revision to have metadata', MIDAS_INVALID_POLICY);
Severity: Minor
Found in core/controllers/ItemController.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 '128', column '23').
Open

            throw new Zend_Exception('itemId should be a number');
Severity: Minor
Found in core/controllers/ItemController.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 '360', column '23').
Open

            throw new Zend_Exception('Please set the itemId.');
Severity: Minor
Found in core/controllers/ItemController.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 '644', column '27').
Open

                throw new Zend_Exception('The item must have at least one revision to have metadata', MIDAS_INVALID_POLICY);
Severity: Minor
Found in core/controllers/ItemController.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 '543', column '23').
Open

            throw new Zend_Exception("This item doesn't exist or you don't have the permissions.");
Severity: Minor
Found in core/controllers/ItemController.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 '61', column '30').
Open

            $validator = new Zend_Validate_Digits();
Severity: Minor
Found in core/controllers/ItemController.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 '352', column '30').
Open

            $validator = new Zend_Validate_Digits();
Severity: Minor
Found in core/controllers/ItemController.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 '354', column '27').
Open

                throw new Zend_Exception('Must specify an itemId parameter');
Severity: Minor
Found in core/controllers/ItemController.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 '534', column '23').
Open

            throw new Zend_Exception('bitstreamId should be a number');
Severity: Minor
Found in core/controllers/ItemController.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

The method editmetadataAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $metadataItemRevision = $this->Item->getLastRevision($itemDao);
        }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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

The method viewAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $metadataItemRevision = $itemRevision;
            }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 'JsonComponent' in method 'deletebitstreamAction'.
Open

            echo JsonComponent::encode(true);
Severity: Minor
Found in core/controllers/ItemController.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

The method getmetadatavalueexistsAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $exists = 0;
            }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 'JsonComponent' in method 'checksharedAction'.
Open

        echo JsonComponent::encode($ifShared);
Severity: Minor
Found in core/controllers/ItemController.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

Avoid using static access to class 'UtilityComponent' in method 'viewAction'.
Open

        $this->view->itemSize = UtilityComponent::formatSize($itemDao->getSizebytes());
Severity: Minor
Found in core/controllers/ItemController.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

Avoid using static access to class 'JsonComponent' in method 'getmetadatavalueexistsAction'.
Open

        echo JsonComponent::encode($metadataValueExists);
Severity: Minor
Found in core/controllers/ItemController.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

The method getmetadatavalueexistsAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $itemDao = $this->Item->load($itemId);
            if ($itemDao === false) {
                throw new Zend_Exception("This item doesn't exist.", 404);
            }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 'JsonComponent' in method 'viewAction'.
Open

                echo JsonComponent::encode(array(true, $this->t('Changes saved')));
Severity: Minor
Found in core/controllers/ItemController.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

The method viewAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->view->preview = false;
        }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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

The method viewAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $breadcrumbs[] = array('type' => 'folder', 'object' => $parent);
            }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 'UtilityComponent' in method 'viewAction'.
Open

            UtilityComponent::setCookie($request, $cookieName, serialize($recentItems), $expires);
Severity: Minor
Found in core/controllers/ItemController.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

Avoid using static access to class 'MidasLoader' in method 'thumbnailAction'.
Open

            $downloadBitstreamComponent = MidasLoader::loadComponent('DownloadBitstream');
Severity: Minor
Found in core/controllers/ItemController.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

The method deleteAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->redirect('/');
        }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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

The method mergeAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->redirect('/item/'.$mainItem->getKey());
        }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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

The method getmetadatavalueexistsAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $metadataItemRevision = $this->Item->getLastRevision($itemDao);
            }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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

The method deletebitstreamAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            echo JsonComponent::encode(true);
        }
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 'JsonComponent' in method 'mergeAction'.
Open

            echo JsonComponent::encode(array('redirect' => $this->view->webroot.'/item/'.$mainItem->getKey()));
Severity: Minor
Found in core/controllers/ItemController.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

Avoid excessively long variable names like $downloadBitstreamComponent. Keep variable name length under 20.
Open

            $downloadBitstreamComponent = MidasLoader::loadComponent('DownloadBitstream');
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class ItemController extends AppController

The property $_daos is not named in camelCase.
Open

class ItemController extends AppController
{
    public $_models = array('Item', 'ItemRevision', 'Bitstream', 'Folder', 'Metadata', 'License', 'Progress');
    public $_daos = array();
    public $_components = array('Breadcrumb', 'Date', 'Sortdao');
Severity: Minor
Found in core/controllers/ItemController.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 ItemController extends AppController
{
    public $_models = array('Item', 'ItemRevision', 'Bitstream', 'Folder', 'Metadata', 'License', 'Progress');
    public $_daos = array();
    public $_components = array('Breadcrumb', 'Date', 'Sortdao');
Severity: Minor
Found in core/controllers/ItemController.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 $_forms is not named in camelCase.
Open

class ItemController extends AppController
{
    public $_models = array('Item', 'ItemRevision', 'Bitstream', 'Folder', 'Metadata', 'License', 'Progress');
    public $_daos = array();
    public $_components = array('Breadcrumb', 'Date', 'Sortdao');
Severity: Minor
Found in core/controllers/ItemController.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 $_models is not named in camelCase.
Open

class ItemController extends AppController
{
    public $_models = array('Item', 'ItemRevision', 'Bitstream', 'Folder', 'Metadata', 'License', 'Progress');
    public $_daos = array();
    public $_components = array('Breadcrumb', 'Date', 'Sortdao');
Severity: Minor
Found in core/controllers/ItemController.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

Avoid variables with short names like $i. Configured minimum length is 3.
Open

            $i = 0;
Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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

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

    public $_models = array('Item', 'ItemRevision', 'Bitstream', 'Folder', 'Metadata', 'License', 'Progress');

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

    public $_forms = array('Item');

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

    public $_daos = array();

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

    public $_components = array('Breadcrumb', 'Date', 'Sortdao');

Line exceeds 120 characters; contains 121 characters
Open

            if (isset($deleteMetadata) && !empty($deleteMetadata) && $this->view->isModerator) { // delete metadata field

Line exceeds 120 characters; contains 124 characters
Open

                throw new Zend_Exception('The item must have at least one revision to have metadata', MIDAS_INVALID_POLICY);

Line exceeds 120 characters; contains 124 characters
Open

                throw new Zend_Exception('The item must have at least one revision to have metadata', MIDAS_INVALID_POLICY);

Line exceeds 120 characters; contains 156 characters
Open

            'This item is currrently shared by other folders and/or communities. Deletion will make it disappear in all these folders and/or communitites. '

The variable $item_id is not named in camelCase.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 $item_id is not named in camelCase.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 $item_id is not named in camelCase.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 $item_id is not named in camelCase.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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 $item_id is not named in camelCase.
Open

    public function editAction()
    {
        $this->disableLayout();
        $item_id = $this->getParam('itemId');

Severity: Minor
Found in core/controllers/ItemController.php by phpmd

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

There are no issues that match your filters.

Category
Status