XoopsModules25x/apcal

View on GitHub

Showing 1,049 of 26,336 total issues

Function load has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function load($data, &$datLen)
    {
        $datLen = 0;

        while (true) {
Severity: Minor
Found in thumbs/phpthumb.gif.php - About 1 hr 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 RenderToFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function RenderToFile($filename)
    {
        if (preg_match('#^[a-z0-9]+://#i', $filename)) {
            $this->DebugMessage('RenderToFile() failed because $filename (' . $filename . ') is a URL', __FILE__, __LINE__);

Severity: Minor
Found in thumbs/phpthumb.class.php - About 1 hr 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 FixedAspectRatio has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function FixedAspectRatio()
    {
        // optional fixed-dimension images (regardless of aspect ratio)

        if (!$this->far) {
Severity: Minor
Found in thumbs/phpthumb.class.php - About 1 hr 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

Method ImageResizeFunction has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function ImageResizeFunction(&$dst_im, &$src_im, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH)
Severity: Major
Found in thumbs/phpthumb.class.php - About 1 hr to fix

    Function Brightness has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function Brightness(&$gdimg, $amount = 0)
        {
            if ($amount == 0) {
                return true;
            }
    Severity: Minor
    Found in thumbs/phpthumb.filters.php - About 1 hr 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

    Method ImageCopyResampleBicubic has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $dst_img,
            $src_img,
            $dst_x,
            $dst_y,
            $src_x,
    Severity: Major
    Found in thumbs/phpthumb.functions.php - About 1 hr to fix

      Function SafeExec has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function SafeExec($command)
          {
              static $AllowedExecFunctions = array();
              if (empty($AllowedExecFunctions)) {
                  $AllowedExecFunctions = array('shell_exec' => true, 'passthru' => true, 'system' => true, 'exec' => true);
      Severity: Minor
      Found in thumbs/phpthumb.functions.php - About 1 hr 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 Outline has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          hs.Outline = function (outlineType, onLoad) {
              this.onLoad = onLoad;
              this.outlineType = outlineType;
              var v = hs.uaVersion, tr;
      
      
      Severity: Minor
      Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

        Function sizeOverlayBox has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                sizeOverlayBox: function (doWrapper, doPanels) {
                    var overlayBox = this.overlayBox,
                        x = this.x,
                        y = this.y;
                    hs.setStyles(overlayBox, {
        Severity: Minor
        Found in assets/images/js/highslide/highslide.js - About 1 hr to fix

          Function Outline has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              hs.Outline = function (outlineType, onLoad) {
                  this.onLoad = onLoad;
                  this.outlineType = outlineType;
                  var v = hs.uaVersion, tr;
          
          
          Severity: Minor
          Found in assets/images/js/highslide/highslide.js - About 1 hr to fix

            Function sizeOverlayBox has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    sizeOverlayBox: function (doWrapper, doPanels) {
                        var overlayBox = this.overlayBox,
                            x = this.x,
                            y = this.y;
                        hs.setStyles(overlayBox, {
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr to fix

              Function close has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      close: function () {
                          if (this.isClosing || !this.isExpanded) return;
                          if (this.transitions[1] == 'crossfade' && hs.upcoming) {
                              hs.getExpander(hs.upcoming).cancelLoading();
                              hs.upcoming = null;
              Severity: Minor
              Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

                Function sizeOverlayBox has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        sizeOverlayBox: function (doWrapper, doPanels) {
                            var overlayBox = this.overlayBox,
                                x = this.x,
                                y = this.y;
                            hs.setStyles(overlayBox, {
                Severity: Minor
                Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

                  Function Outline has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      hs.Outline = function (outlineType, onLoad) {
                          this.onLoad = onLoad;
                          this.outlineType = outlineType;
                          var v = hs.uaVersion, tr;
                  
                  
                  Severity: Minor
                  Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr to fix

                    Function justify has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            justify: function (p, moveOnly) {
                                var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
                    
                                var hasMovedMin = false;
                    
                    
                    Severity: Minor
                    Found in assets/images/js/highslide/highslide.js - About 1 hr to fix

                      Function Outline has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          hs.Outline = function (outlineType, onLoad) {
                              this.onLoad = onLoad;
                              this.outlineType = outlineType;
                              var v = hs.uaVersion, tr;
                      
                      
                      Severity: Minor
                      Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr to fix

                        Function sizeOverlayBox has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                sizeOverlayBox: function (doWrapper, doPanels) {
                                    var overlayBox = this.overlayBox,
                                        x = this.x,
                                        y = this.y;
                                    hs.setStyles(overlayBox, {
                        Severity: Minor
                        Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr to fix

                          Function justify has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  justify: function (p, moveOnly) {
                                      var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
                          
                                      var hasMovedMin = false;
                          
                          
                          Severity: Minor
                          Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr to fix

                            Method apcal_thedays_schedule_show_tpl has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function apcal_thedays_schedule_show_tpl($options)
                                {
                                    global $xoopsConfig, $xoopsDB;
                            
                                    $moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];
                            Severity: Minor
                            Found in blocks/apcal_thedays_schedule.php - About 1 hr to fix

                              Method get_daily has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      public function get_daily($get_target = '', $query_string = '', $for_print = false)
                                      {
                                          // $PHP_SELF = $_SERVER['SCRIPT_NAME'] ;
                                          // if( $get_target == '' ) $get_target = $PHP_SELF ;
                              
                              
                              Severity: Minor
                              Found in class/APCal.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language