mambax7/pedigree

View on GitHub

Showing 702 of 1,100 total issues

Function isInOpenBasedir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function isInOpenBasedir($path)
    {
        static $open_basedirs = null;
        if (null === $open_basedirs) {
            $ini_text = ini_get('open_basedir');
Severity: Minor
Found in phpthumb/phpthumb.class.php - About 35 mins to fix

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 setSourceData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setSourceData($rawImageData, $sourceFilename = '')
    {
        //$this->resetObject();
        //$this->sourceFilename = null;
        $this->rawImageData = $rawImageData;
Severity: Minor
Found in phpthumb/phpthumb.class.php - About 35 mins to fix

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 Threshold has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function Threshold(&$gdimg, $cutoff)
    {
        $width  = imagesx($gdimg);
        $height = imagesy($gdimg);
        $cutoff = min(255, max(0, ($cutoff ? $cutoff : 128)));
Severity: Minor
Found in phpthumb/phpthumb.filters.php - About 35 mins to fix

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 Negative has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function Negative(&$gdimg)
    {
        if (phpthumb_functions::version_compare_replacement(PHP_VERSION, '5.0.0', '>=') && phpthumb_functions::gd_is_bundled()) {
            if (imagefilter($gdimg, IMG_FILTER_NEGATE)) {
                return true;
Severity: Minor
Found in phpthumb/phpthumb.filters.php - About 35 mins to fix

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 ImageCopyResampleBicubic has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function ImageCopyResampleBicubic($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h)
    {
        // ron at korving dot demon dot nl
        // http://www.php.net/imagecopyresampled

Severity: Minor
Found in phpthumb/phpthumb.functions.php - About 35 mins to fix

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 FunctionIsDisabled has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function FunctionIsDisabled($function)
    {
        static $DisabledFunctions = null;
        if (null === $DisabledFunctions) {
            $disable_functions_local  = explode(',', strtolower(@ini_get('disable_functions')));
Severity: Minor
Found in phpthumb/phpthumb.functions.php - About 35 mins to fix

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 ProportionalResize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function ProportionalResize($old_width, $old_height, $new_width = false, $new_height = false)
    {
        $old_aspect_ratio = $old_width / $old_height;
        if (($new_width === false) && ($new_height === false)) {
            return false;
Severity: Minor
Found in phpthumb/phpthumb.functions.php - About 35 mins to fix

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->crop(

                                floor(($target_width - $width) / 2),
                                $target_height - $height,
                                floor(($target_width - $width) / 2) + $width,
Severity: Major
Found in library/Zebra_Image.php - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return false;
    Severity: Major
    Found in assets/js/jquery.magnific-popup.js - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                                  return $this->crop(
      
                                      floor(($target_width - $width) / 2),
                                      floor(($target_height - $height) / 2),
                                      floor(($target_width - $width) / 2) + $width,
      Severity: Major
      Found in library/Zebra_Image.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                                    return $this->crop(
        
                                        $target_width - $width,
                                        $target_height - $height,
                                        $target_width,
        Severity: Major
        Found in library/Zebra_Image.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return false;
          Severity: Major
          Found in library/Zebra_Image.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                return $this->_write_image($target_identifier);
            Severity: Major
            Found in library/Zebra_Image.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return false;
              Severity: Major
              Found in library/Zebra_Image.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                            return $this->crop(
                
                                                0,
                                                $target_height - $height,
                                                $width,
                Severity: Major
                Found in library/Zebra_Image.php - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return true;
                  Severity: Major
                  Found in assets/js/jquery.magnific-popup.js - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                        return false;
                    Severity: Major
                    Found in library/Zebra_Image.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                                  return $this->crop(
                      
                                                      $target_width - $width,
                                                      floor(($target_height - $height) / 2),
                                                      $target_width,
                      Severity: Major
                      Found in library/Zebra_Image.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return $this->_write_image($target_identifier);
                        Severity: Major
                        Found in library/Zebra_Image.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return false;
                          Severity: Major
                          Found in library/Zebra_Image.php - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language