mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

Function rotate has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function rotate($angle, $options = null)
    {
        if (!($angle == $this->_rotation_angle($angle))) {
            // No rotation needed
            return true;
Severity: Minor
Found in class/pear/Image/Transform/Driver/NetPBM.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 PclTarHandlePathReduction has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    function PclTarHandlePathReduction($p_dir)
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarHandlePathReduction', "dir='$p_dir'");
        $v_result = '';

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

    public function _resize($new_x, $new_y, $options = null)
    {
        // there's no technical reason why resize can't be called multiple
        // times...it's just silly to do so
        $scaleMethod = $this->_getOption('scaleMethod', $options, 'smooth');
Severity: Minor
Found in class/pear/Image/Transform/Driver/NetPBM.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 PclTarAddList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    function PclTarAddList($p_tarname, $p_filelist, $p_add_dir = '', $p_remove_dir = '', $p_mode = '')
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarAddList', "tar=$p_tarname, file=$p_filelist, p_add_dir='$p_add_dir', p_remove_dir='$p_remove_dir', mode=$p_mode");
        $v_result      = 1;
        $p_list_detail = [];
Severity: Minor
Found in class/pcltar.lib.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 postPhotoTraitement has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function postPhotoTraitement($file, $checkMd5 = false)
    {
        //        require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/photoUploader.php';

        $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
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 _largePhotoTreatment has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function _largePhotoTreatment($photoName)
    {
        /** @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 bind has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        bind: function( elem, value ) {

            // todo: revise if alternative tooltip is needed for mobile devices
            if (Galleria.TOUCH) {
                return;
Severity: Minor
Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

    Function bind has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            bind: function( elem, value ) {
    
                // todo: revise if alternative tooltip is needed for mobile devices
                if (Galleria.TOUCH) {
                    return;
    Severity: Minor
    Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

      Function raise has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Galleria.raise = function( msg, fatal ) {
      
          var type = fatal ? 'Fatal error' : 'Error',
      
              css = {
      Severity: Minor
      Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

        Function raise has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Galleria.raise = function( msg, fatal ) {
        
            var type = fatal ? 'Fatal error' : 'Error',
        
                css = {
        Severity: Minor
        Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

          Method _raiseError has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected static function _raiseError(
                  $object,
                  $message = null,
                  $code = null,
                  $mode = null,
          Severity: Minor
          Found in class/pear/PEAR.php - About 1 hr to fix

            Method createCat has 39 lines of code (exceeds 25 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

              Function _scaleImage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _scaleImage : function( image, options ) {
              
                      image = image || this._controls.getActive();
              
                      // janpub (JH) fix:
              Severity: Minor
              Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

                Function _scaleImage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _scaleImage : function( image, options ) {
                
                        image = image || this._controls.getActive();
                
                        // janpub (JH) fix:
                Severity: Minor
                Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

                  Method cloneBlock has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function cloneBlock($bid)
                      {
                          xoops_cp_header();
                          $moduleDirName      = \basename(\dirname(__DIR__));
                          $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                  Severity: Minor
                  Found in admin/blocksadmin.php - About 1 hr to fix

                    Method getSearchedPhoto has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getSearchedPhoto($queryArray, $condition, $limit, $start, $userId)
                        {
                            $criteria = new CriteriaCompo();
                            if ($userId > 0) {
                                $criteria->add(new Criteria('uid', $userId));
                    Severity: Minor
                    Found in class/PhotoHandler.php - About 1 hr to fix

                      Function _initResizeVideo has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function _initResizeVideo( $slide, ratio, maxWidth, maxHeight )
                          {
                              var $video = $slide.children();
                      
                              $slide
                      Severity: Minor
                      Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

                        Method get_default_parameters has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function get_default_parameters()
                            {
                                $params = [
                                    'type'           => 'flex',
                                    'random'         => false,
                        Severity: Minor
                        Found in assets/js/ml-slider/inc/slider/metaslider.class.php - About 1 hr to fix

                          Method editBlock has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function editBlock($bid)
                              {
                                  //require __DIR__ . '/admin_header.php';
                                  xoops_cp_header();
                                  $moduleDirName = \basename(\dirname(__DIR__));
                          Severity: Minor
                          Found in admin/blocksadmin.php - About 1 hr to fix

                            Method encode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function encode($textarea_id)
                                {
                                    \xoops_loadLanguage('extention', 'extgallery');
                            
                                    /*   $code       = "<img src='"
                            Severity: Minor
                            Found in EXTRA/class/textsanitizer/gallery/MytsGallery.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language