mambax7/songlist

View on GitHub

Showing 264 of 3,642 total issues

Function _renderOptionTree has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = []): void
    {
        if ($option['id'] > 0) :
            $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
            foreach ($parentIds as $pid) {
Severity: Minor
Found in admin/permissions.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 deleteDirectory has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public static function deleteDirectory($src): bool
    {
        // Only continue if user is a 'global' Admin
        if (!($GLOBALS['xoopsUser'] instanceof XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
            return false;
Severity: Minor
Found in class/Common/FilesManagement.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

Method getIPData has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getIPData($ip = false): array
    {
        $ret = [];
        if (\is_object($GLOBALS['xoopsUser'])) {
            $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
Severity: Major
Found in class/Utility.php - About 2 hrs to fix

    Method getFormGenre has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method getFormVoice has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Method getFormArtists has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function populateList has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function populateList($vars, $ownid = 0): void
              {
                  foreach ($vars as $previd => $cats) {
                      if ($previd != $ownid || 0 == $ownid) {
                          foreach ($cats as $catid => $title) {
          Severity: Minor
          Found in class/Form/SelectCategoryForm.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 cloneFileFolder has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function cloneFileFolder($path)
              {
                  global $patKeys;
                  global $patValues;
          
          
          Severity: Minor
          Found in class/Common/Cloner.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 render has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render(?array $block = null): void
              {
                  \xoops_load('XoopsFormLoader');
                  \xoops_loadLanguage('common', $this->moduleDirNameUpper);
          
          
          Severity: Minor
          Found in class/Common/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

          Method getFormUtf8map has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

                public static function getUserSearchForm($action = false)
                {
                    \xoops_loadLanguage('forms', 'songlist');
            
                    if (!$action) {
            Severity: Minor
            Found in class/Form/FormController.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

            Method isBlockCloned has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function isBlockCloned(int $bid, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
                {
                    \xoops_loadLanguage('admin', 'system');
                    \xoops_loadLanguage('admin/blocksadmin', 'system');
                    \xoops_loadLanguage('admin/groups', 'system');
            Severity: Major
            Found in class/Common/Blocksadmin.php - About 2 hrs to fix

              Method toArray has 50 lines of code (exceeds 25 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 2 hrs to fix

                Function getFormAlbums has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function  getFormAlbums($object, $as_array = false)
                    {
                        if (!\is_object($object)) {
                            $handler = Helper::getInstance()
                                             ->getHandler('Albums');
                Severity: Minor
                Found in class/Form/FormController.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 getFormCategory has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function  getFormCategory($object, $as_array = false)
                    {
                        if (!\is_object($object)) {
                            $handler = Helper::getInstance()
                                             ->getHandler('Category');
                Severity: Minor
                Found in class/Form/FormController.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 getFormRequests has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function  getFormRequests($object, $as_array = false)
                    {
                        if (!\is_object($object)) {
                            $handler = Helper::getInstance()
                                             ->getHandler('Requests');
                Severity: Minor
                Found in class/Form/FormController.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 getFormVotes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function  getFormVotes($object, $as_array = false)
                    {
                        if (!\is_object($object)) {
                            $handler = Helper::getInstance()
                                             ->getHandler('Votes');
                Severity: Minor
                Found in class/Form/FormController.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 getFilterElement has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getFilterElement($filter, $field, $sort = 'created', $op = '', $fct = '')
                    {
                        $components = static::getFilterURLComponents($filter, $field, $sort);
                        $ele        = false;
                        require_once \dirname(__DIR__) . '/include/songlist.object.php';
                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

                Method orderBlock has 15 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        array $bid,
                        array $oldtitle,
                        array $oldside,
                        array $oldweight,
                        array $oldvisible,
                Severity: Major
                Found in class/Common/Blocksadmin.php - About 1 hr to fix

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

                      public function toArray($extra = true): array
                      {
                          $ret  = parent::toArray();
                          $form = $this->getForm(true);
                          foreach ($form as $key => $element) {
                  Severity: Minor
                  Found in class/Albums.php - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language