mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

Function updateBlock has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    function updateBlock($bid, $btitle, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options, $groups)
    {
        $myblock = new \XoopsBlock($bid);
        $myblock->setVar('title', $btitle);
        $myblock->setVar('weight', $bweight);
Severity: Minor
Found in admin/blocksadmin.php - About 2 hrs 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 _dirToStruct has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function _dirToStruct($sPath, $maxinst, $aktinst = 0, $silent = false)
    {
        $struct = ['dirs' => [], 'files' => []];
        if (false === ($dir = @opendir($sPath))) {
            if (!$silent) {
Severity: Minor
Found in class/pear/System.php - About 2 hrs 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 extgalleryAjax has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function extgalleryAjax($options)
{
    $photos = [];
    /** @var Extgallery\PhotoHandler $photoHandler */
    $photoHandler       = Extgallery\Helper::getInstance()->getHandler('PublicPhoto');
Severity: Minor
Found in blocks/extgallery_blocks.php - About 2 hrs 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 getDescendants has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 getDescendants has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDescendants(
        $id = 0,
        $includeSelf = false,
        $childrenOnly = false,
        $withRestrict = true,
Severity: Minor
Found in class/CategoryHandler.php - About 2 hrs 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 load has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Galleria.prototype.load = function() {

    // pass if no data is provided or picasa option not found
    if ( arguments.length || typeof this._options.picasa !== 'string' ) {
        load.apply( this, Galleria.utils.array( arguments ) );
Severity: Major
Found in assets/js/galleria/plugins/picasa/galleria.picasa.js - About 2 hrs to fix

    Function init has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            init: function (options) {
    
                Galleria.requires(1.33, 'This version of Classic theme requires Galleria 1.3.3 or later');
    
                // add some elements
    Severity: Major
    Found in assets/js/galleria/themes/classic/galleria.classic.js - About 2 hrs to fix

      Function init has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              init: function (options) {
      
                  Galleria.requires(1.33, 'This version of Classic theme requires Galleria 1.3.3 or later');
      
                  // add some elements
      Severity: Major
      Found in assets/js/galleria/galleria.classic.js - About 2 hrs to fix

        Function slideshow has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function slideshow() {
                var
                timeOut,
                className = prefix + "Slideshow_",
                click = "click." + prefix,
        Severity: Major
        Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js - About 2 hrs to fix

          Method factory has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function &factory($driver = '')
              {
                  if ('' == $driver) {
                      $extensions = [
                          'imagick' => 'Imagick3',
          Severity: Major
          Found in class/pear/Image/Transform.php - About 2 hrs to fix

            Function _exit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _exit: function( callback ) {
            
                        fullscreen.active = false;
            
                        var inBrowser = !self._options.trueFullscreen || !_nativeFullscreen.support,
            Severity: Minor
            Found in assets/js/galleria/galleria-1.3.5.js - About 2 hrs to fix

              Function _exit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _exit: function( callback ) {
              
                          fullscreen.active = false;
              
                          var inBrowser = !self._options.trueFullscreen || !_nativeFullscreen.support,
              Severity: Minor
              Found in assets/js/galleria/galleria-1.3.3.js - About 2 hrs to fix

                Function FlameViewportScale has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function FlameViewportScale() {
                    this.delay = 600; // Delay after calling update to account for viewport bounce
                    this.orientation;
                    this.screenWidth; // Screen width corrected for orientation
                    this.timeout;
                Severity: Minor
                Found in assets/js/TosRUs/lib/FlameViewportScale.js - About 2 hrs to fix

                  Method getAll has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function &getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true)
                      {
                          if ($fields && \is_array($fields)) {
                              if (!\in_array($this->handler->keyName, $fields)) {
                                  $fields[] = $this->handler->keyName;
                  Severity: Minor
                  Found in class/ModelReadIterator.php - About 2 hrs to fix

                    Function addTheme has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Galleria.addTheme = function( theme ) {
                    
                        // make sure we have a name
                        if ( !theme.name ) {
                            Galleria.raise('No theme name specified');
                    Severity: Minor
                    Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

                      Function addTheme has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Galleria.addTheme = function( theme ) {
                      
                          // make sure we have a name
                          if ( !theme.name ) {
                              Galleria.raise('No theme name specified');
                      Severity: Minor
                      Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

                        Method _parseLongOption has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx, $args, $skip_unknown)
                            {
                                @list($opt, $opt_arg) = explode('=', $arg, 2);
                        
                                $opt_len = strlen($opt);
                        Severity: Minor
                        Found in class/pear/Console/Getopt.php - About 1 hr to fix

                          Method render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function render()
                              {
                                  // load all child ids for javascript codes
                                  foreach (\array_keys($this->_itemTree) as $item_id) {
                                      $this->_itemTree[$item_id]['allchild'] = [];
                          Severity: Minor
                          Found in class/GroupPermForm.php - About 1 hr to fix

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

                                            complete: function( next ) {
                            
                                                // toggle low quality for IE
                                                if ( 'image' in active ) {
                                                    Utils.toggleQuality( active.image, false );
                            Severity: Minor
                            Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

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

                                              complete: function( next ) {
                              
                                                  // toggle low quality for IE
                                                  if ( 'image' in active ) {
                                                      Utils.toggleQuality( active.image, false );
                              Severity: Minor
                              Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language