midasplatform/Midas

View on GitHub
core/controllers/CommunityController.php

Summary

Maintainability
F
1 wk
Test Coverage

manageAction accesses the super-global variable $_POST.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

manageAction accesses the super-global variable $_POST.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

manageAction accesses the super-global variable $_POST.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

File CommunityController.php has 737 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/CommunityController.php - About 1 day to fix

Function manageAction has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');
Severity: Minor
Found in core/controllers/CommunityController.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

Method manageAction has 197 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');
Severity: Major
Found in core/controllers/CommunityController.php - About 7 hrs to fix

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

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');
Severity: Major
Found in core/controllers/CommunityController.php - About 4 hrs to fix

The class CommunityController has 14 public methods. Consider refactoring CommunityController to keep number of public methods under 10.
Open

class CommunityController extends AppController
{
    public $_models = array(
        'Community',
        'Folder',

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

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

class CommunityController extends AppController
{
    public $_models = array(
        'Community',
        'Folder',

Function sendinvitationAction has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in core/controllers/CommunityController.php - About 2 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

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

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');
Severity: Minor
Found in core/controllers/CommunityController.php - About 2 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 sendinvitationAction has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

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

    public function promoteuserAction()
    {
        $this->disableLayout();
        $this->_helper->viewRenderer->setNoRender();

Severity: Minor
Found in core/controllers/CommunityController.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 promoteuserAction has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function promoteuserAction()
    {
        $this->disableLayout();
        $this->_helper->viewRenderer->setNoRender();

Severity: Minor
Found in core/controllers/CommunityController.php - About 1 hr to fix

Method addusertogroupAction has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in core/controllers/CommunityController.php - About 1 hr to fix

Method promotedialogAction has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function promotedialogAction()
    {
        $this->disableLayout();

        if (!$this->logged) {
Severity: Minor
Found in core/controllers/CommunityController.php - About 1 hr to fix

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

    private function _sendUserInvitation($userDao, $groupDao)
    {
        if ($this->Group->userInGroup($userDao, $groupDao)) {
            echo JsonComponent::encode(
                array(false, $userDao->getFullName().' is already a member of this community')
Severity: Minor
Found in core/controllers/CommunityController.php - About 1 hr to fix

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

    public function indexAction()
    {
        $this->view->header = $this->t('Communities');
        $this->view->json['community']['createCommunity'] = $this->t('Create a community');
        $this->view->json['community']['titleCreateLogin'] = $this->t('Please log in');
Severity: Minor
Found in core/controllers/CommunityController.php - About 1 hr to fix

Function promotedialogAction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function promotedialogAction()
    {
        $this->disableLayout();

        if (!$this->logged) {
Severity: Minor
Found in core/controllers/CommunityController.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 removeuserfromgroupAction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function removeuserfromgroupAction()
    {
        $this->disableLayout();
        $this->_helper->viewRenderer->setNoRender();

Severity: Minor
Found in core/controllers/CommunityController.php - About 1 hr to fix

Method selectgroupAction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function selectgroupAction()
    {
        $this->disableLayout();

        $communityId = $this->getParam('communityId');
Severity: Minor
Found in core/controllers/CommunityController.php - About 1 hr to fix

Function addusertogroupAction has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in core/controllers/CommunityController.php - About 45 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 selectgroupAction has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function selectgroupAction()
    {
        $this->disableLayout();

        $communityId = $this->getParam('communityId');
Severity: Minor
Found in core/controllers/CommunityController.php - About 45 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 removeuserfromgroupAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function removeuserfromgroupAction()
    {
        $this->disableLayout();
        $this->_helper->viewRenderer->setNoRender();

Severity: Minor
Found in core/controllers/CommunityController.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 invitationAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function invitationAction()
    {
        $this->disableLayout();

        $communityId = $this->getParam('communityId');
Severity: Minor
Found in core/controllers/CommunityController.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 _sendUserInvitation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function _sendUserInvitation($userDao, $groupDao)
    {
        if ($this->Group->userInGroup($userDao, $groupDao)) {
            echo JsonComponent::encode(
                array(false, $userDao->getFullName().' is already a member of this community')
Severity: Minor
Found in core/controllers/CommunityController.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 manageAction() has 219 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

The method promoteuserAction() has an NPath complexity of 480. The configured NPath complexity threshold is 200.
Open

    public function promoteuserAction()
    {
        $this->disableLayout();
        $this->_helper->viewRenderer->setNoRender();

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 promotedialogAction() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
Open

    public function promotedialogAction()
    {
        $this->disableLayout();

        if (!$this->logged) {

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 756. The configured NPath complexity threshold is 200.
Open

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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 manageAction() has an NPath complexity of 4210020. The configured NPath complexity threshold is 200.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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 119 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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

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

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 promotedialogAction() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
Open

    public function promotedialogAction()
    {
        $this->disableLayout();

        if (!$this->logged) {

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 16. The configured cyclomatic complexity threshold is 10.
Open

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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 manageAction() has a Cyclomatic Complexity of 35. The configured cyclomatic complexity threshold is 10.
Open

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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 promoteuserAction() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
Open

    public function promoteuserAction()
    {
        $this->disableLayout();
        $this->_helper->viewRenderer->setNoRender();

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 '66', column '23').
Open

            throw new Zend_Exception("This community doesn't exist or you don't have the permissions.", 403);

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 '137', column '31').
Open

                    throw new Zend_Exception('Community Admin permissions required.', 403);

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 '826', column '23').
Open

            throw new Zend_Exception('Must be logged in');

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 '734', column '23').
Open

            throw new Zend_Exception('Must be logged in');

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 '834', column '23').
Open

            throw new Zend_Exception('Must pass a userId parameter');

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 '86', column '31').
Open

                    throw new Zend_Exception('Community Admin permissions required.', 403);

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 '153', column '31').
Open

                    throw new Zend_Exception('Community Admin permissions required.', 403);

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 '740', column '23').
Open

            throw new Zend_Exception('Must pass a community parameter');

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 '752', column '23').
Open

            throw new Zend_Exception('User is not in community members group');

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 '580', column '27').
Open

                throw new Zend_Exception('Specified group is not in the specified community');

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 '592', column '27').
Open

                throw new Zend_Exception('Invalid userId');

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 '785', column '23').
Open

            throw new Zend_Exception('Must pass a communityId parameter');

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 '442', column '23').
Open

            throw new Zend_Exception('Community ID should be a number');

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 '485', column '23').
Open

            throw new Zend_Exception('Invalid communityId', 404);

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 '325', column '23').
Open

            throw new Zend_Exception("This community doesn't exist or you don't have the permissions.", 403);

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 '797', column '23').
Open

            throw new Zend_Exception('User is not in community members group');

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 '801', column '23').
Open

            throw new Zend_Exception('Community Admin permissions required.', 403);

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 '320', column '23').
Open

            throw new Zend_Exception('Community ID should be a number');

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 '568', column '23').
Open

            throw new Zend_Exception('Invalid communityId', 404);

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 '583', column '27').
Open

                throw new Zend_Exception('Only members of the admin group may invite users to the admin group');

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 '809', column '31').
Open

                    throw new Zend_Exception('Invalid group id: '.$id);

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 '104', column '31').
Open

                    throw new Zend_Exception('Community Admin permissions required.', 403);

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 '177', column '31').
Open

                    throw new Zend_Exception('Community Admin permissions required.', 403);

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 '780', column '23').
Open

            throw new Zend_Exception('Must be logged in');

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 '451', column '23').
Open

            throw new Zend_Exception("This community doesn't exist or you don't have the permissions.", 403);

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 '626', column '23').
Open

            throw new Zend_Exception('Must pass userId or email parameter');

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 '788', column '23').
Open

            throw new Zend_Exception('Must pass a userId parameter');

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 '794', column '23').
Open

            throw new Zend_Exception('Invalid user or community parameter');

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 '572', column '23').
Open

            throw new Zend_Exception('Write permission required on the community', 403);

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 '831', column '23').
Open

            throw new Zend_Exception('Must pass a groupId parameter');

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 '876', column '23').
Open

            throw new Zend_Exception('Moderator or admin privileges required', 403);

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 '868', column '23').
Open

            throw new Zend_Exception('Community id parameter required');

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 '513', column '23').
Open

            throw new Zend_Exception('Admin permission required on the community', 403);

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 '743', column '23').
Open

            throw new Zend_Exception('Must pass a user parameter');

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 '840', column '23').
Open

            throw new Zend_Exception('Invalid user or group parameter');

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 '846', column '23').
Open

            throw new Zend_Exception('Community Admin permissions required.', 403);

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 '481', column '23').
Open

            throw new Zend_Exception('Must pass a communityId parameter');

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 '756', column '23').
Open

            throw new Zend_Exception('Community Admin permissions required.', 403);

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 '872', column '23').
Open

            throw new Zend_Exception('Community '.$communityId.' does not exist', 404);

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 '57', column '23').
Open

            throw new Zend_Exception('Community ID should be a number');

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 '489', column '23').
Open

            throw new Zend_Exception('Write permission required on the community', 403);

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 '749', column '23').
Open

            throw new Zend_Exception('Invalid user or community parameter');

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 sendinvitationAction 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(array(true, 'Invitation created but not sent'));
                }

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 invitationAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $directAdd = 0;
        }

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 sendinvitationAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            throw new Zend_Exception('Must pass userId or email parameter');
        }

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(false, $this->t('Error')));

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 indexAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $communities = $this->User->getUserCommunities($this->userSession->Dao);
            $communities = array_merge($communities, $this->Community->getPublicCommunities());
            $this->view->siteAdmin = false;
        }

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 '_sendUserInvitation'.
Open

            echo JsonComponent::encode(
                array(false, $userDao->getFullName().' is already a member of this community')
            );

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(true, $this->t('Changes saved'), $infoForm->getValue('name')));

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 manageAction 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(array(false, $this->t('Error')));
                }

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 manageAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $users = explode('-', $this->getParam('users'));
                    $usersDao = $this->User->load($users);
                    foreach ($usersDao as $userDao) {
                        $this->Group->addUser($group, $userDao);

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 'addusertogroupAction'.
Open

                echo JsonComponent::encode(array(true, 'User added and notification sent to '.$email));

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 _sendUserInvitation 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(array(true, 'Invitation not sent'));
            }

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(true, $this->t('Changes saved')));

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(false, $this->t('Error')));

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 'manageAction'.
Open

                            echo JsonComponent::encode(array(false, $this->t('Error')));

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

            UtilityComponent::markdown(htmlspecialchars($communityDao->getDescription(), ENT_COMPAT, 'UTF-8')),

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 sendinvitationAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $group = $community->getMemberGroup();
        }

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 createAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->disableLayout();
            $this->view->form = $this->getFormAsArray($form);
        }

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 'removeuserfromgroupAction'.
Open

        echo JsonComponent::encode(
            array(true, 'Removed user '.$user->getFullName().' from group '.$group->getName())
        );

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 'manageAction'.
Open

                        echo JsonComponent::encode(array(true, $this->t('Changes saved'), $new_group->toArray()));

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(false, $this->t('Error')));

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 '_sendUserInvitation'.
Open

            echo JsonComponent::encode(
                array(false, $userDao->getFullName().$this->t(' is already invited to this community.'))
            );

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 '_sendUserInvitation'.
Open

                echo JsonComponent::encode(array(true, 'Invitation not sent'));

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(true, $this->t('Changes saved')));

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 'manageAction'.
Open

                        echo JsonComponent::encode(array(true, $this->t('Changes saved'), $group->toArray()));

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 manageAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $this->Group->delete($group);
                    echo JsonComponent::encode(array(true, $this->t('Changes saved')));
                }

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(false, $this->t('Error')));

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 'addusertogroupAction'.
Open

            echo JsonComponent::encode(array(false, 'Unable to add user'));

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 manageAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $users = explode('-', $this->getParam('users'));
                    $usersDao = $this->User->load($users);
                    foreach ($usersDao as $userDao) {
                        $this->Group->removeUser($group, $userDao);

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 validentryAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    echo 'false';
                }

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(false, $this->t('Error')));

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(false, $this->t('Error')));

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 manageAction 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(array(false, $this->t('Error')));
                }

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 manageAction 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(array(false, $this->t('Error')));
                }

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(true, $this->t('Changes saved')));

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 'addusertogroupAction'.
Open

                echo JsonComponent::encode(array(true, 'User added but notification not sent'));

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 '_sendUserInvitation'.
Open

                echo JsonComponent::encode(array(true, 'Invitation sent to '.$email));

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 sendinvitationAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                /** @var NewUserInvitationModel $newuserModel */
                $newuserModel = MidasLoader::loadModel('NewUserInvitation');
                $newuserinvite = $newuserModel->createInvitation($email, $group, $this->userSession->Dao);

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 'sendinvitationAction'.
Open

                    echo JsonComponent::encode(array(true, 'Invitation created but not sent'));

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 'manageAction'.
Open

                    echo JsonComponent::encode(array(true, $this->t('Changes saved')));

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 addusertogroupAction 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(array(true, 'User added but notification not sent'));
            }

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 addusertogroupAction 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(array(false, 'Unable to add user'));
        }

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 manageAction uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                    } else {
                        $group = $this->Group->load($this->getParam('groupId'));
                        if ($group == false || $group->getCommunity()->getKey() != $communityDao->getKey()
                        ) {
                            echo JsonComponent::encode(array(false, $this->t('Error')));

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 'MidasLoader' in method 'sendinvitationAction'.
Open

                $newuserModel = MidasLoader::loadModel('NewUserInvitation');

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 'sendinvitationAction'.
Open

                    echo JsonComponent::encode(array(true, 'Invitation sent to '.$email));

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 'promoteuserAction'.
Open

        echo JsonComponent::encode(array(true, 'Successfully added user to groups'));

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 _sendUserInvitation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $email = $userDao->getEmail();
            $url = $this->getServerURL().$this->view->webroot;
            $subject = 'Community Invitation';
            $body = 'You have been invited to join the <b>'.$community->getName().'</b> community at '.$url.'.<br/><br/>'.'<a href="'.$url.'/community/'.$community->getKey().'">'.'Click here</a> to see the community, and click the "Join the community" button '.'if you wish to join.';

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (isset($removeUser)) { // remove users from group
                if (!$this->Community->policyCheck($communityDao, $this->userSession->Dao, MIDAS_POLICY_ADMIN)
                ) {
                    throw new Zend_Exception('Community Admin permissions required.', 403);
                }
Severity: Major
Found in core/controllers/CommunityController.php and 1 other location - About 6 hrs to fix
core/controllers/CommunityController.php on lines 101..118

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 211.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (isset($addUser)) { // add users to group
                if (!$this->Community->policyCheck($communityDao, $this->userSession->Dao, MIDAS_POLICY_ADMIN)
                ) {
                    throw new Zend_Exception('Community Admin permissions required.', 403);
                }
Severity: Major
Found in core/controllers/CommunityController.php and 1 other location - About 6 hrs to fix
core/controllers/CommunityController.php on lines 83..100

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 211.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

class CommunityController extends AppController

The property $_models is not named in camelCase.
Open

class CommunityController extends AppController
{
    public $_models = array(
        'Community',
        'Folder',

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 CommunityController extends AppController
{
    public $_models = array(
        'Community',
        'Folder',

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 CommunityController extends AppController
{
    public $_models = array(
        'Community',
        'Folder',

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 CommunityController extends AppController
{
    public $_models = array(
        'Community',
        'Folder',

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 $id. Configured minimum length is 3.
Open

                list(, $id) = explode('_', $name);

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

Method name "_sendUserInvitation" should not be prefixed with an underscore to indicate visibility
Open

    private function _sendUserInvitation($userDao, $groupDao)

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

    public $_models = array(

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

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

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

    public $_daos = array('Community', 'Folder', 'Group', 'Folderpolicygroup', 'Group', 'User');

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

    public $_forms = array('Community');

Line exceeds 120 characters; contains 245 characters
Open

            $body = $this->userSession->Dao->getFullName().' has added you to the <b>'.$community->getName().'</b> community on Midas Platform.<br/><br/><a href="'.$url.'/community/'.$community->getKey().'">Click here</a> to see the community.';

Line exceeds 120 characters; contains 338 characters
Open

                $body = $this->userSession->Dao->getFullName().' has invited you to join the <b>'.$community->getName().'</b> community on Midas Platform.<br/><br/>'.'<a href="'.$url.'/user/emailregister?email='.$email.'&authKey='.$newuserinvite->getAuthKey().'">Click here</a> to complete your user registration '.'if you wish to join.';

Line exceeds 120 characters; contains 284 characters
Open

            $body = 'You have been invited to join the <b>'.$community->getName().'</b> community at '.$url.'.<br/><br/>'.'<a href="'.$url.'/community/'.$community->getKey().'">'.'Click here</a> to see the community, and click the "Join the community" button '.'if you wish to join.';

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                MIDAS_POLICY_WRITE

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                MIDAS_POLICY_ADMIN

Multi-line function call not indented correctly; expected 8 spaces but found 12
Open

            )

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                $communityDao,

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                $this->userSession->Dao,

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                ) || $group->getKey() == $moderator_group->getKey()

Multi-line function call not indented correctly; expected 8 spaces but found 12
Open

            )

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                $this->userSession->Dao,

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                $communityDao,

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                ) != $community->getModeratorgroupId() && $group->getKey() != $community->getAdmingroupId()

The variable $group_member is not named in camelCase.
Open

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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

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

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

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

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function manageAction()
    {
        $communityId = $this->getParam('communityId');
        if (!isset($communityId) || !is_numeric($communityId)) {
            throw new Zend_Exception('Community ID should be a number');

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

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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

    public function viewAction()
    {
        $this->view->Utility = $this->Component->Utility;
        $this->view->Date = $this->Component->Date;
        $communityId = $this->getParam('communityId');

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 method _sendUserInvitation is not named in camelCase.
Open

    private function _sendUserInvitation($userDao, $groupDao)
    {
        if ($this->Group->userInGroup($userDao, $groupDao)) {
            echo JsonComponent::encode(
                array(false, $userDao->getFullName().' is already a member of this community')

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status