mambax7/songlist

View on GitHub

Showing 264 of 3,642 total issues

Method getFormSongs has 154 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function  getFormSongs($object, $as_array = false)
    {
        if (!\is_object($object)) {
            $handler = Helper::getInstance()
                             ->getHandler('Songs');
Severity: Major
Found in class/Form/FormController.php - About 6 hrs to fix

    File JSON.php has 421 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php declare(strict_types=1);
    
    /*
    Module: Document
    
    
    Severity: Minor
    Found in class/JSON.php - About 6 hrs to fix

      File Field.php has 415 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php declare(strict_types=1);
      
      namespace XoopsModules\Songlist;
      
      use function base64_decode;
      Severity: Minor
      Found in class/Field.php - About 5 hrs to fix

        Function toArray has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            public function toArray($extra = true): array
            {
                $ret = parent::toArray();
        
                $GLOBALS['myts'] = MyTextSanitizer::getInstance();
        Severity: Minor
        Found in class/Songs.php - About 5 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 getEditElement has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getEditElement($user, $profile)
            {
                $value = \in_array($this->getVar('field_name'), $this->getPostVars(), true) ? $user->getVar($this->getVar('field_name'), 'e') : $profile->getVar($this->getVar('field_name'), 'e');
                if (null === $value) {
                    $value = $this->getVar('field_default');
        Severity: Minor
        Found in class/Field.php - About 5 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 getSearchElement has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getSearchElement()
            {
                $caption = $this->getVar('field_title');
                $caption = \defined($caption) ? \constant($caption) : $caption;
                $name    = $this->getVar('field_name', 'e');
        Severity: Minor
        Found in class/Field.php - About 5 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 insert has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            public function insert(\XoopsObject $obj, $force = false)
            {
                $objectsHandler = \XoopsModules\Songlist\Helper::getInstance()->getHandler('Extras');
                $obj->setVar('field_name', \str_replace(' ', '_', $obj->getVar('field_name')));
                $obj->cleanVars();
        Severity: Minor
        Found in class/FieldHandler.php - About 5 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

        Method _encode has 126 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _encode($var)
            {
                switch (gettype($var)) {
                    case 'boolean':
                        return $var ? 'true' : 'false';
        Severity: Major
        Found in class/JSON.php - About 5 hrs to fix

          Method getEditElement has 123 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getEditElement($user, $profile)
              {
                  $value = \in_array($this->getVar('field_name'), $this->getPostVars(), true) ? $user->getVar($this->getVar('field_name'), 'e') : $profile->getVar($this->getVar('field_name'), 'e');
                  if (null === $value) {
                      $value = $this->getVar('field_default');
          Severity: Major
          Found in class/Field.php - About 4 hrs to fix

            Function listBlocks has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                public function listBlocks(): void
                {
                    global $xoopsModule, $pathIcon16;
                    require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
                    //        xoops_loadLanguage('admin', 'system');
            Severity: Minor
            Found in class/Common/Blocksadmin.php - About 4 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

            Method insert has 115 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function insert(\XoopsObject $obj, $force = false)
                {
                    $objectsHandler = \XoopsModules\Songlist\Helper::getInstance()->getHandler('Extras');
                    $obj->setVar('field_name', \str_replace(' ', '_', $obj->getVar('field_name')));
                    $obj->cleanVars();
            Severity: Major
            Found in class/FieldHandler.php - About 4 hrs to fix

              Method getSearchElement has 114 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getSearchElement()
                  {
                      $caption = $this->getVar('field_title');
                      $caption = \defined($caption) ? \constant($caption) : $caption;
                      $name    = $this->getVar('field_name', 'e');
              Severity: Major
              Found in class/Field.php - About 4 hrs to fix

                File index.php has 347 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php declare(strict_types=1);
                
                use XoopsModules\Songlist\Form\SelectCategoryForm;
                use XoopsModules\Songlist\Form\SelectGenreForm;
                use XoopsModules\Songlist\Form\SelectVoiceForm;
                Severity: Minor
                Found in index.php - About 4 hrs to fix

                  Method insert has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function insert(\XoopsObject $obj, $force = true)
                      {
                          if ($obj->isNew()) {
                              $obj->setVar('created', \time());
                              $new      = true;
                  Severity: Major
                  Found in class/RequestsHandler.php - About 3 hrs to fix

                    Method xml2array has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function xml2array($contents, $get_attributes = 1, $priority = 'tag')
                        {
                            if (!$contents) {
                                return [];
                            }
                    Severity: Major
                    Found in class/Utility.php - About 3 hrs to fix

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

                          public function render(?array $block = null): void
                          {
                              \xoops_load('XoopsFormLoader');
                              \xoops_loadLanguage('common', $this->moduleDirNameUpper);
                      
                      
                      Severity: Major
                      Found in class/Common/Blocksadmin.php - About 3 hrs to fix

                        Method toArray has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function toArray($extra = true): array
                            {
                                $ret = parent::toArray();
                        
                                $GLOBALS['myts'] = MyTextSanitizer::getInstance();
                        Severity: Major
                        Found in class/Songs.php - About 3 hrs to fix

                          Function xoops_module_update_vs_executesql has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function xoops_module_update_vs_executesql($sql): bool
                          {
                              if (is_string($sql)) {
                                  if ($GLOBALS['xoopsDB']->queryF($sql)) {
                                      xoops_error($sql, 'SQL Executed Successfully!!!');
                          Severity: Minor
                          Found in include/update.php - About 3 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

                          File permissions.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php declare(strict_types=1);
                          /*
                           * You may not change or alter any portion of this comment or credits
                           * of supporting developers from this source code or any supporting source code
                           * which is considered copyrighted (c) material of the original comment or credit authors.
                          Severity: Minor
                          Found in admin/permissions.php - About 3 hrs to fix

                            Function toArray has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function toArray($extra = false): array
                                {
                                    $ret  = parent::toArray();
                                    $form = $this->getForm(true);
                                    foreach ($form as $key => $element) {
                            Severity: Minor
                            Found in class/Artists.php - About 3 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

                            Severity
                            Category
                            Status
                            Source
                            Language