XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Avoid excessively long variable names like $text_background_alpha. Keep variable name length under 20.
Open

                    $text_background_alpha = round(127 * ((100 - min(max(0, $bg_opacity), 100)) / 100));
Severity: Minor
Found in thumbs/phpthumb.filters.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $get_defined_functions. Keep variable name length under 20.
Open

            static $get_defined_functions = array();
Severity: Minor
Found in thumbs/phpthumb.functions.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $watermark_destination_y. Keep variable name length under 20.
Open

                $watermark_destination_y = (int)$matches[2];
Severity: Minor
Found in thumbs/phpthumb.filters.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $apacheLookupURIobject. Keep variable name length under 20.
Open

            if ($apacheLookupURIobject = @apache_lookup_uri($filename)) {
Severity: Minor
Found in thumbs/phpthumb.functions.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $BrokenURLfopenPHPversions. Keep variable name length under 20.
Open

        $BrokenURLfopenPHPversions = array('4.4.2');
Severity: Minor
Found in thumbs/phpthumb.functions.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $disable_functions_local. Keep variable name length under 20.
Open

            $disable_functions_local  = explode(',', strtolower(@ini_get('disable_functions')));
Severity: Minor
Found in thumbs/phpthumb.functions.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $disable_functions_global. Keep variable name length under 20.
Open

            $disable_functions_global = explode(',', strtolower(@get_cfg_var('disable_functions')));
Severity: Minor
Found in thumbs/phpthumb.functions.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $gdimg_hexcolorallocate. Keep variable name length under 20.
Open

        &$gdimg_hexcolorallocate,
Severity: Minor
Found in thumbs/phpthumb.functions.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Identical blocks of code found in 4 locations. Consider refactoring.
Open

                hs.container = hs.createElement('div', {
                        className: 'highslide-container'
                    }, {
                        position: 'absolute',
                        left: 0,
Severity: Major
Found in assets/images/js/highslide/highslide.js and 3 other locations - About 1 hr to fix
assets/images/js/highslide/highslide-full.js on lines 925..937
assets/images/js/highslide/highslide-with-gallery.js on lines 749..761
assets/images/js/highslide/highslide-with-html.js on lines 748..760

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 4 locations. Consider refactoring.
Open

                hs.container = hs.createElement('div', {
                        className: 'highslide-container'
                    }, {
                        position: 'absolute',
                        left: 0,
Severity: Major
Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 1 hr to fix
assets/images/js/highslide/highslide-with-gallery.js on lines 749..761
assets/images/js/highslide/highslide-with-html.js on lines 748..760
assets/images/js/highslide/highslide.js on lines 585..597

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 4 locations. Consider refactoring.
Open

                hs.container = hs.createElement('div', {
                        className: 'highslide-container'
                    }, {
                        position: 'absolute',
                        left: 0,
Severity: Major
Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 1 hr to fix
assets/images/js/highslide/highslide-full.js on lines 925..937
assets/images/js/highslide/highslide-with-html.js on lines 748..760
assets/images/js/highslide/highslide.js on lines 585..597

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 4 locations. Consider refactoring.
Open

                hs.container = hs.createElement('div', {
                        className: 'highslide-container'
                    }, {
                        position: 'absolute',
                        left: 0,
Severity: Major
Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 1 hr to fix
assets/images/js/highslide/highslide-full.js on lines 925..937
assets/images/js/highslide/highslide-with-gallery.js on lines 749..761
assets/images/js/highslide/highslide.js on lines 585..597

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function correctRatio has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        correctRatio: function (ratio) {
            var x = this.x,
                y = this.y,
                changed = false,
                xSize = Math.min(x.full, x.size),
Severity: Minor
Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

    Function correctRatio has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            correctRatio: function (ratio) {
                var x = this.x,
                    y = this.y,
                    changed = false,
                    xSize = Math.min(x.full, x.size),
    Severity: Minor
    Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr to fix

      Function correctRatio has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              correctRatio: function (ratio) {
                  var x = this.x,
                      y = this.y,
                      changed = false,
                      xSize = Math.min(x.full, x.size),
      Severity: Minor
      Found in assets/images/js/highslide/highslide.js - About 1 hr to fix

        Function createOverlay has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                createOverlay: function (o) {
                    var el = o.overlayId,
                        relToVP = (o.relativeTo == 'viewport' && !/panel$/.test(o.position));
                    if (typeof el == 'string') el = hs.getNode(el);
                    if (o.html) el = hs.createElement('div', {innerHTML: o.html});
        Severity: Minor
        Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

          Function correctRatio has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  correctRatio: function (ratio) {
                      var x = this.x,
                          y = this.y,
                          changed = false,
                          xSize = Math.min(x.full, x.size),
          Severity: Minor
          Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr to fix

            Method apcal_monthly_calendar_show has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function apcal_monthly_calendar_show($options)
                {
                    global $xoopsConfig, $xoopsDB;
            
            
            
            Severity: Minor
            Found in blocks/apcal_monthly_calendar.php - About 1 hr to fix

              Method get_tz_options has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public function get_tz_options($selected = 0)
                      {
                          $tzs = array(
                              '-12',
                              '-11',
              Severity: Minor
              Found in class/APCal.php - About 1 hr to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                if (phpthumb_functions::IsHexColor($bg_color)) {
                                    $text_background_alpha = round(127 * ((100 - min(max(0, $bg_opacity), 100)) / 100));
                                    $text_color_background = phpthumb_functions::ImageHexColorAllocate($gdimg, $bg_color, false, $text_background_alpha);
                                } else {
                                    $text_color_background = phpthumb_functions::ImageHexColorAllocate($gdimg, 'FFFFFF', false, 127);
                Severity: Major
                Found in thumbs/phpthumb.filters.php and 1 other location - About 1 hr to fix
                thumbs/phpthumb.filters.php on lines 1644..1649

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 113.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language