VinaBB/VinaBB.vn

View on GitHub

Function has too many statements (47). Maximum allowed is 30.
Open

$(function()
Severity: Minor
Found in styles/vinabb/contrib/js/custom.js by eslint

enforce a maximum number of statements allowed in function blocks (max-statements)

The max-statements rule allows you to specify the maximum number of statements allowed in a function.

js function foo() { var bar = 1; // one statement var baz = 2; // two statements var qux = 3; // three statements }

Rule Details

This rule enforces a maximum number of statements allowed in function blocks.

Options

This rule has a number or object option:

  • "max" (default 10) enforces a maximum number of statements allows in function blocks

Deprecated: The object property maximum is deprecated; please use the object property max instead.

This rule has an object option:

  • "ignoreTopLevelFunctions": true ignores top-level functions

max

Examples of incorrect code for this rule with the default { "max": 10 } option:

```js /eslint max-statements: ["error", 10]/ /eslint-env es6/

function foo() { var foo1 = 1; var foo2 = 2; var foo3 = 3; var foo4 = 4; var foo5 = 5; var foo6 = 6; var foo7 = 7; var foo8 = 8; var foo9 = 9; var foo10 = 10;

var foo11 = 11; // Too many. }

let foo = () => { var foo1 = 1; var foo2 = 2; var foo3 = 3; var foo4 = 4; var foo5 = 5; var foo6 = 6; var foo7 = 7; var foo8 = 8; var foo9 = 9; var foo10 = 10;

var foo11 = 11; // Too many. }; ```

Examples of correct code for this rule with the default { "max": 10 } option:

```js /eslint max-statements: ["error", 10]/ /eslint-env es6/

function foo() { var foo1 = 1; var foo2 = 2; var foo3 = 3; var foo4 = 4; var foo5 = 5; var foo6 = 6; var foo7 = 7; var foo8 = 8; var foo9 = 9; var foo10 = 10; return function () {

// The number of statements in the inner function does not count toward the
// statement maximum.

return 42;

}; }

let foo = () => { var foo1 = 1; var foo2 = 2; var foo3 = 3; var foo4 = 4; var foo5 = 5; var foo6 = 6; var foo7 = 7; var foo8 = 8; var foo9 = 9; var foo10 = 10; return function () {

// The number of statements in the inner function does not count toward the
// statement maximum.

return 42;

}; } ```

ignoreTopLevelFunctions

Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

```js /eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]/

function foo() { var foo1 = 1; var foo2 = 2; var foo3 = 3; var foo4 = 4; var foo5 = 5; var foo6 = 6; var foo7 = 7; var foo8 = 8; var foo9 = 9; var foo10 = 10; var foo11 = 11; } ```

Related Rules

  • [complexity](complexity.md)
  • [max-depth](max-depth.md)
  • [max-len](max-len.md)
  • [max-nested-callbacks](max-nested-callbacks.md)
  • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

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

class setting_helper
{
    /** @var \vinabb\web\controllers\cache\service_interface $cache */
    protected $cache;

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

The class setting_tasks has 12 public methods. Consider refactoring setting_tasks to keep number of public methods under 10.
Open

class setting_tasks implements setting_tasks_interface
{
    /** @var \vinabb\web\controllers\cache\service_interface $cache */
    protected $cache;

Since: PHPMD 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'.

```

Source: http://phpmd.org/rules/codesize.txt

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

class portal_articles implements portal_articles_interface
{
    /** @var \vinabb\web\controllers\cache\service_interface $cache */
    protected $cache;

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class forum implements forum_interface
{
    /** @var \phpbb\auth\auth $auth */
    protected $auth;

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class topic implements topic_interface
{
    /** @var \phpbb\auth\auth $auth */
    protected $auth;

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class service extends service_core implements service_interface
{
    /** @var \phpbb\cache\driver\driver_interface $driver */
    protected $driver;

Since: PHPMD 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'.

```

Source: http://phpmd.org/rules/codesize.txt

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

class service extends service_core implements service_interface
{
    /** @var \phpbb\cache\driver\driver_interface $driver */
    protected $driver;

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class helper implements helper_interface
{
    /** @var \vinabb\web\controllers\cache\service_interface $cache */
    protected $cache;

Severity: Minor
Found in ext/vinabb/web/controllers/helper.php by phpmd

Since: PHPMD 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'.

```

Source: http://phpmd.org/rules/codesize.txt

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

class helper implements helper_interface
{
    /** @var \vinabb\web\controllers\cache\service_interface $cache */
    protected $cache;

Severity: Minor
Found in ext/vinabb/web/controllers/helper.php by phpmd

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class mcp
{
    /** @var \phpbb\auth\auth $auth */
    protected $auth;

Severity: Minor
Found in ext/vinabb/web/controllers/mcp.php by phpmd

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class ucp implements ucp_interface
{
    /** @var \phpbb\auth\auth $auth */
    protected $auth;

Severity: Minor
Found in ext/vinabb/web/controllers/ucp.php by phpmd

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class online implements online_interface
{
    /** @var \phpbb\auth\auth */
    protected $auth;

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class profile
{
    /** @var \phpbb\auth\auth $auth */
    protected $auth;

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class user
{
    /** @var \phpbb\auth\auth */
    protected $auth;

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class bb_author extends author_social implements bb_author_interface
{
    /** @var \phpbb\db\driver\driver_interface $db */
    protected $db;

Severity: Minor
Found in ext/vinabb/web/entities/bb_author.php by phpmd

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

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

class headline implements headline_interface
{
    /** @var \phpbb\db\driver\driver_interface $db */
    protected $db;

Severity: Minor
Found in ext/vinabb/web/entities/headline.php by phpmd

Since: PHPMD 0.2.5

The Weighted Method Count (WMC) of a class is a good indicator of how much time and effort is required to modify and maintain this class. The WMC metric is defined as the sum of complexities of all methods declared in a class. A large number of methods also means that this class has a greater potential impact on derived classes.

Example:

```php

class Foo { public function bar() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } public function baz() { if ($a == $b) { if ($a1 == $b1) { fiddle(); } elseif ($a2 == $b2) { fiddle(); } else { } } } // Several other complex methods }

```

Source: http://phpmd.org/rules/codesize.txt

The class helper has 33 non-getter- and setter-methods. Consider refactoring helper to keep number of methods under 25.
Open

class helper implements helper_interface
{
    /** @var ContainerInterface $container */
    protected $container;

Since: PHPMD 0.1

A class with too many 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'. The default was changed from 10 to 25 in PHPMD 2.3.

```

Source: http://phpmd.org/rules/codesize.txt

The class helper has 30 public methods. Consider refactoring helper to keep number of public methods under 10.
Open

class helper implements helper_interface
{
    /** @var ContainerInterface $container */
    protected $container;

Since: PHPMD 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'.

```

Source: http://phpmd.org/rules/codesize.txt

The class forum_desc_rules has 12 public methods. Consider refactoring forum_desc_rules to keep number of public methods under 10.
Open

class forum_desc_rules extends bbcode_content
{
    /** @var array $data */
    protected $data;

Since: PHPMD 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'.

```

Source: http://phpmd.org/rules/codesize.txt

Severity
Category
Status