Showing 25 of 164 total issues
Method callback
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function callback()
{
switch ($this->outputElement->getAttribute('data-do')) {
case 'embedPin':
if (!$this->outputElement->getAttribute('data-url')) {
Function callback
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function callback()
{
switch ($this->outputElement->getAttribute('data-do')) {
case 'embedPin':
if (!$this->outputElement->getAttribute('data-url')) {
- 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
Method getConfigTreeBuilder
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('elephantly_amp_converter');
Function convertToAmp
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function convertToAmp($element)
{
// Initialize
$this->inputElement = $element;
$this->isInputValid = true;
- 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
Function callback
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function callback()
{
$this->outputElement->setAttribute('sandbox', isset($this->options['sandbox']) ? $this->options['sandbox'] : '');
if (!AmpDimensionsCleaner::isLegal($this->outputElement->getAttribute('width'))) {
- 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
Function convert
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function convert($input)
{
if (!$input) {
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
Function callback
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function callback()
{
$src = $this->inputElement->getAttribute('data-href');
preg_match('/https:\/\/www.facebook\.com\/\w*\/(\w*)\/\d*/', $src, $embedType);
switch ($embedType) {
- 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
Method callback
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function callback()
{
$src = $this->inputElement->getAttribute('data-href');
preg_match('/https:\/\/www.facebook\.com\/\w*\/(\w*)\/\d*/', $src, $embedType);
switch ($embedType) {
Method convert
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function convert($input)
{
if (!$input) {
return '';
}
Function callback
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function callback()
{
$isConsistent = (AmpDimensionsCleaner::isLegal($this->outputElement->getAttribute('width')) && AmpDimensionsCleaner::isLegal($this->outputElement->getAttribute('height')));
if (!$isConsistent) {
- 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
Function getDefaultValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getDefaultValue($attribute)
{
switch ($attribute) {
case 'layout':
return 'responsive';
- 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
Function callback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function callback()
{
foreach ($this->inputElement->childNodes as $tag) {
- 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
Function callback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function callback()
{
foreach ($this->inputElement->childNodes as $tag) {
- 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 too many return
statements within this method. Open
return $this->oembed['height'] ? $this->oembed['height'] : 400;
Avoid too many return
statements within this method. Open
return 315;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return '486';