Showing 17 of 17 total issues
Method abbc3_bbcodes
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function abbc3_bbcodes()
{
return array(
// These exist in core
'b',
Avoid excessively long variable names like $abbc3_bbcode_deprecated. Keep variable name length under 20. Open
$abbc3_bbcode_deprecated = $this->abbc3_bbcodes();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Method faq
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function faq()
{
// Set the block template data
$this->template->assign_block_vars('faq_block', [
'BLOCK_TITLE' => $this->language->lang('ABBC3_FAQ_TITLE'),
Method update_schema
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update_schema()
{
return array(
'drop_tables' => array(
$this->table_prefix . 'clicks',
Function bbvideo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function bbvideo(Configurator $configurator)
{
if (!isset($configurator->BBCodes['bbvideo']))
{
return;
- Read upRead up
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
Missing class import via use statement (line '115', column '14'). Open
return new \acp_bbcodes();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '104', column '15'). Open
throw new \RuntimeException($this->language->lang('FORM_INVALID'), E_USER_WARNING);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '149', column '14'). Open
throw new \RuntimeException(implode('<br>', $this->errors), E_USER_WARNING);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Remove error control operator '@' on line 224. Open
protected function valid_url($url)
{
$headers = function_exists('get_headers') ? @get_headers($url) : false;
return !$headers || stripos($headers[0], '200 OK') !== false;
}
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '152', column '13'). Open
throw new \RuntimeException($this->language->lang('CONFIG_UPDATED'), E_USER_NOTICE);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Function clear_reparsers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function clear_reparsers()
{
/** @var \phpbb\textreparser\manager $reparser_manager */
$reparser_manager = $this->container->get('text_reparser.manager');
- Read upRead up
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
Avoid unused local variables such as '$tag'. Open
foreach ($configurator->MediaEmbed->defaultSites as $tagName => $tag)
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
The method __construct has 10 parameters. Consider reducing the number of parameters to less than 10. Open
public function __construct(cache $cache, config $config, db_text $db_text, db $db, ext_manager $ext_manager, language $language, request $request, template $template, $parser_key, $renderer_key)
{
$this->cache = $cache;
$this->config = $config;
$this->config_text = $db_text;
- Exclude checks
Avoid unused local variables such as '$reparser'. Open
foreach ($reparsers as $name => $reparser)
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$ext'. Open
foreach ($icons as $path => $ext)
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Definition for rule 'multiline-comment-style' was not found Open
var requestRunning = false;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Parsing error: The keyword 'const' is reserved Open
const abbc3mainBox = document.querySelector("#abbc3_buttons");
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/