mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

    public function createCat($data)
    {
        /** @var Extgallery\PublicCategory $cat */
        $cat = $this->create();
        $cat->setVars($data);
Severity: Minor
Found in class/PublicCategoryHandler.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 rebuild has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function rebuild()
    {
        $data = $this->getTreeWithChildren();

        $n     = 0; // need a variable to hold the running n tally
Severity: Minor
Found in class/CategoryHandler.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 Create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function Create($sFilename = '')
    {
        // check for required gd functions
        if (!\function_exists('imagecreate') || !\function_exists("image$this->sFileType")
            || ('' != $this->vBackgroundImages && !\function_exists('imagecreatetruecolor'))) {
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 _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

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

                    self._controls.frames[ self._controls.active ].scale({
                        width: self._stageWidth,
                        height: self._stageHeight,
                        iframelimit: self._options.maxVideoSize
                    });
    Severity: Major
    Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 1 hr to fix
    assets/js/galleria/galleria-1.3.3.js on lines 4697..4701

    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 63.

    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 2 locations. Consider refactoring.
    Open

                self._controls.frames[ self._controls.active ].scale({
                    width: self._stageWidth,
                    height: self._stageHeight,
                    iframelimit: self._options.maxVideoSize
                });
    Severity: Major
    Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 1 hr to fix
    assets/js/galleria/galleria-1.3.5.js on lines 4718..4722

    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 63.

    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

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

            arg.push(function(data) {
                self._data = data;
                loader.remove();
                self.trigger( Galleria.DATA );
                p.options.complete.call(p, data);
    Severity: Major
    Found in assets/js/galleria/plugins/picasa/galleria.picasa.js and 1 other location - About 1 hr to fix
    assets/js/galleria/plugins/flickr/galleria.flickr.js on lines 368..375

    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 63.

    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

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

            f[ flickr[0] ]( flickr[1], function( data ) {
    
                self._data = data;
                loader.remove();
                self.trigger( Galleria.DATA );
    Severity: Major
    Found in assets/js/galleria/plugins/flickr/galleria.flickr.js and 1 other location - About 1 hr to fix
    assets/js/galleria/plugins/picasa/galleria.picasa.js on lines 304..309

    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 63.

    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 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
                      Severity
                      Category
                      Status
                      Source
                      Language