src/Core/Field/Social.php
Method getSocialNetworks
has 212 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getSocialNetworks()
{
return array(
'twitter' => array(
'url' => OlympusZeus::translate('http://www.twitter.com/'),
File Social.php
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace crewstyle\OlympusZeus\Core\Field;
use crewstyle\OlympusZeus\OlympusZeus;
Function hex2rgb
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function hex2rgb($hexcolor)
{
preg_match("/^#{0,1}([0-9a-f]{1,6})$/i", $hexcolor, $match);
if (!isset($match[1])) {
- 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 hex2rgb
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function hex2rgb($hexcolor)
{
preg_match("/^#{0,1}([0-9a-f]{1,6})$/i", $hexcolor, $match);
if (!isset($match[1])) {
Method prepareField
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function prepareField($content, $details = array())
{
//Build details
$post = isset($details['post']) ? $details['post'] : 0;
$prefix = isset($details['prefix']) ? $details['prefix'] : '';
Function prepareField
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
public function prepareField($content, $details = array())
{
//Build details
$post = isset($details['post']) ? $details['post'] : 0;
$prefix = isset($details['prefix']) ? $details['prefix'] : '';
- 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"