Showing 13 of 13 total issues
Method __construct
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(ModuleContainerInterface $container)
{
parent::__construct($container);
if ($container instanceof Renderer) {
Missing class import via use statement (line '114', column '23'). Open
throw new \InvalidArgumentException(sprintf(
- 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
Avoid assigning values to variables in if clauses and the like (line '108', column '27'). Open
protected function getLanguageKeywordValue($value, KeywordElement $keyword, $name)
{
$value = trim($value, "()\"' \t\n\r\0\x0B");
if (!in_array($value, $this->languages, true)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '77', column '14'). Open
public function handleNodeEvent(NodeEvent $event)
{
/* @var CommentNode $node */
if (($node = $event->getNode()) instanceof CommentNode &&
!$node->isVisible() &&
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '80', column '14'). Open
public function handleNodeEvent(NodeEvent $event)
{
/* @var CommentNode $node */
if (($node = $event->getNode()) instanceof CommentNode &&
!$node->isVisible() &&
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '132', column '13'). Open
public function handleNodeLanguageKeyword($value, KeywordElement $keyword, $name)
{
$value = $this->getLanguageKeywordValue($value, $keyword, $name);
if ($next = $keyword->getNextSibling()) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Call to undeclared method \JsPhpize\JsPhpizePhug::getOption
Open
if ($this->getOption('language') === 'php') {
- Exclude checks
Call to undeclared method \JsPhpize\JsPhpizePhug::setOptionsRecursive
Open
$this->setOptionsRecursive($compiler->getOption(['module_options', 'jsphpize']));
- Exclude checks
Call to undeclared method \JsPhpize\JsPhpizePhug::getOption
Open
$next->appendChild(new KeywordElement('language', $this->getOption('language'), $keyword->getOriginNode()));
- Exclude checks
Possibly zero references to use statement for classlike/namespace Compiler
(\Phug\Compiler)
Open
use Phug\Compiler;
- Exclude checks
Argument 1 (compiler)
is \Phug\Util\ModuleContainerInterface
but \JsPhpize\JsPhpizePhug::getJsPhpizeEngine()
takes \Phug\CompilerInterface
defined at /code/src/JsPhpize/Traits/Compilation.php:22
Open
return $this->transformExpression($this->getJsPhpizeEngine($compiler), $code, $compiler->getPath());
- Exclude checks
Call to undeclared method \JsPhpize\JsPhpizePhug::setOptionsRecursive
Open
$this->setOptionsRecursive([
- Exclude checks
Call to undeclared method \JsPhpize\JsPhpizePhug::setOption
Open
$this->setOption('language', $value);
- Exclude checks