XoopsModules25x/apcal

View on GitHub

Showing 1,049 of 26,336 total issues

Function get_tz_options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        public function get_tz_options($selected = 0)
        {
            $tzs = array(
                '-12',
                '-11',
Severity: Minor
Found in class/APCal.php - About 25 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 matchPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function matchPath($path, $allowed_dirs)
    {
        if (!empty($allowed_dirs)) {
            foreach ($allowed_dirs as $one_dir) {
                if (preg_match('#^' . preg_quote(str_replace(DIRECTORY_SEPARATOR, '/', $this->realPathSafe($one_dir))) . '#', $path)) {
Severity: Minor
Found in thumbs/phpthumb.class.php - About 25 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 phpThumbDebugVarDump has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function phpThumbDebugVarDump($var)
    {
        if (is_null($var)) {
            return 'NULL';
        } elseif (is_bool($var)) {
Severity: Minor
Found in thumbs/phpthumb.class.php - About 25 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 gif_loadFileToGDimageResource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function gif_loadFileToGDimageResource($gifFilename, $bgColor = -1)
{
    if ($gif = gif_loadFile($gifFilename)) {
        if (!phpthumb_functions::FunctionIsDisabled('set_time_limit')) {
            // shouldn't take nearly this long
Severity: Minor
Found in thumbs/phpthumb.gif.php - About 25 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 gif_getSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function gif_getSize($gif, &$width, &$height)
{
    if (isset($gif) && (@get_class($gif) == 'cgif') && $gif->loaded()) {
        $width  = $gif->width();
        $height = $gif->height();
Severity: Minor
Found in thumbs/phpthumb.gif.php - About 25 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 skipExt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function skipExt(&$data, &$extLen)
    {
        $extLen = 0;

        $b    = ord($data{0});
Severity: Minor
Found in thumbs/phpthumb.gif.php - About 25 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 Ellipse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function Ellipse($gdimg)
    {
        if (phpthumb_functions::gd_version() < 2) {
            return false;
        }
Severity: Minor
Found in thumbs/phpthumb.filters.php - About 25 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 SourceTransparentColorMask has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function SourceTransparentColorMask(&$gdimg, $hexcolor, $min_limit = 5, $max_limit = 10)
    {
        $width  = imagesx($gdimg);
        $height = imagesy($gdimg);
        if ($gdimg_mask = imagecreatetruecolor($width, $height)) {
Severity: Minor
Found in thumbs/phpthumb.filters.php - About 25 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 ApacheLookupURIarray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function ApacheLookupURIarray($filename)
    {
        // apache_lookup_uri() only works when PHP is installed as an Apache module.
        if (php_sapi_name() == 'apache') {
            //$property_exists_exists = function_exists('property_exists');
Severity: Minor
Found in thumbs/phpthumb.functions.php - About 25 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

Severity
Category
Status
Source
Language