Method namedColor2RGB
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function namedColor2RGB($color)
{
static $colornames;
if (!isset($colornames)) {
File ImageColor.php
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace XoopsModules\Pedigree;
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
Function getRange
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getRange($degrees = 2)
{
if (0 == $degrees) {
$degrees = 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
Function changeLightness
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function changeLightness($degree = 10)
{
$color1 = &$this->color1;
$color2 = &$this->color2;
- 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 hsv2hex
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hsv2hex($h, $s, $v)
{
$s /= 256.0;
$v /= 256.0;
if (0.0 == $s) {
Method getRange
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRange($degrees = 2)
{
if (0 == $degrees) {
$degrees = 1;
}
Function hsv2hex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function hsv2hex($h, $s, $v)
{
$s /= 256.0;
$v /= 256.0;
if (0.0 == $s) {
- 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 _makeWebSafe
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function _makeWebSafe(&$color)
{
if ($color < 0x1a) {
$color = 0x00;
} elseif ($color < 0x4d) {
- 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"