mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

Function _mediumPhotoTreatment has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function _mediumPhotoTreatment($photoName, $filePath = null, $mediumFilePath = null)
    {
        /** @var Extgallery\Helper $helper */
        $helper = Extgallery\Helper::getInstance();

Severity: Minor
Found in class/PhotoHandler.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 getModuleOption has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getModuleOption($option)
    {
        global $xoopsModule;
        /** @var \XoopsModules\Extgallery\Helper $helper */
        $helper = \XoopsModules\Extgallery\Helper::getInstance();
Severity: Minor
Found in class/Utility.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 DrawCharacters has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function DrawCharacters()
    {
        $iShadowColour = '';
        // loop through and write out selected number of characters
        for ($i = 0, $iMax = mb_strlen($this->sCode); $i < $iMax; ++$i) {
Severity: Minor
Found in class/PhpCaptcha.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 rescale has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    rescale : function( width, height, complete ) {

        var self = this;

        // allow rescale(fn)
Severity: Minor
Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

    Function Video has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Video = function( type, id ) {
    
            for( var i=0; i<_video._inst.length; i++ ) {
                if ( _video._inst[i].id === id && _video._inst[i].type == type ) {
                    return _video._inst[i];
    Severity: Minor
    Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

      Function Video has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Video = function( type, id ) {
      
              for( var i=0; i<_video._inst.length; i++ ) {
                  if ( _video._inst[i].id === id && _video._inst[i].type == type ) {
                      return _video._inst[i];
      Severity: Minor
      Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

        Function _get_zoom_to has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _get_zoom_to = function () {
                    var view = _get_viewport(),
                        to = {},
                        resize = currentOpts.autoScale,
                        double_padding = currentOpts.padding * 2,
        Severity: Minor
        Found in assets/js/fancybox/fancybox.js - About 1 hr to fix

          Function ccmValidateBlockForm has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function ccmValidateBlockForm() {
          
              if ($('#magnific_type').val() == 'select1') {
                  ccm_addError(ccm_t('selection-required'));
              }

            Method _parseShortOption has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected static function _parseShortOption($arg, $short_options, &$opts, &$argIdx, $args, $skip_unknown)
                {
                    for ($i = 0, $iMax = strlen($arg); $i < $iMax; ++$i) {
                        $opt     = $arg[$i];
                        $opt_arg = null;
            Severity: Minor
            Found in class/pear/Console/Getopt.php - About 1 hr to fix

              Method get_public_slide has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function get_public_slide()
                  {
                      // get the image url (and handle cropping)
                      // disable wp_image_editor if metadata does not exist for the slide
                      $imageHelper = new MetaSliderImageHelper($this->slide->ID, $this->settings['width'], $this->settings['height'], isset($this->settings['smartCrop']) ? $this->settings['smartCrop'] : 'false', $this->use_wp_image_editor());
              Severity: Minor
              Found in assets/js/ml-slider/inc/slide/metaslide.image.class.php - About 1 hr to fix

                Method which has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function which($program, $fallback = false)
                    {
                        // enforce API
                        if (!is_string($program) || '' == $program) {
                            return $fallback;
                Severity: Minor
                Found in class/pear/System.php - About 1 hr to fix

                  Method mktemp has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function mktemp($args = null)
                      {
                          static $first_time = true;
                          $opts = self::_parseArgs($args, 't:d');
                          if (PEAR::isError($opts)) {
                  Severity: Minor
                  Found in class/pear/System.php - About 1 hr to fix

                    Method getDescendants has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getDescendants(
                            $id = 0,
                            $includeSelf = false,
                            $childrenOnly = false,
                            $withRestrict = true,
                    Severity: Minor
                    Found in class/CategoryHandler.php - About 1 hr to fix

                      Method getDescendants has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getDescendants($id = 0, $includeSelf = false, $childrenOnly = false)
                          {
                              $idField = $this->fields['id'];
                      
                              $node = $this->getNode($id);
                      Severity: Minor
                      Found in class/NestedTree.php - About 1 hr to fix

                        Method TrFctStart has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function TrFctStart($p_file, $p_line, $p_name, $p_param = '', $p_message = '')
                            {
                                global $g_pcl_trace_level;
                                global $g_pcl_trace_mode;
                                global $g_pcl_trace_filename;
                        Severity: Minor
                        Found in class/pcltrace.lib.php - About 1 hr to fix

                          Function complete has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                              complete: function( thumb ) {
                          
                                                  // shrink thumbnails to fit
                                                  var top = ['left', 'top'],
                                                      arr = ['Width', 'Height'],
                          Severity: Minor
                          Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

                            Function complete has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                                complete: function( thumb ) {
                            
                                                    // shrink thumbnails to fit
                                                    var top = ['left', 'top'],
                                                        arr = ['Width', 'Height'],
                            Severity: Minor
                            Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

                              Function loop has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      loop: function() {
                              
                                          var distance = this.to - this.pos,
                                              factor = 1;
                              
                              
                              Severity: Minor
                              Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

                                Function buildImage has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            buildImage: function(imageData, isSync) {
                                                var gallery = this;
                                                var nextIndex = this.getNextIndex(imageData.index);
                                
                                                // Construct new hidden span for the image
                                Severity: Minor
                                Found in assets/js/galleriffic/jquery.galleriffic.js - About 1 hr to fix

                                  Function _finish has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          _finish = function () {
                                              if (!$.support.opacity) {
                                                  content.get(0).style.removeAttribute('filter');
                                                  wrap.get(0).style.removeAttribute('filter');
                                              }
                                  Severity: Minor
                                  Found in assets/js/fancybox/fancybox.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language