mambax7/songlist

View on GitHub

Showing 264 of 3,642 total issues

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

    public function getFilterCriteria($filter): \CriteriaCompo
    {
        $parts    = \explode('|', $filter);
        $criteria = new \CriteriaCompo();
        foreach ($parts as $part) {
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 getOutputValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOutputValue($user, $profile)
    {
        \xoops_loadLanguage('modinfo', 'objects');

        $value = \in_array($this->getVar('field_name'), $this->getPostVars(), true) ? $user->getVar($this->getVar('field_name')) : $profile->getVar($this->getVar('field_name'));
Severity: Minor
Found in class/Field.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 getFilterCriteria has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFilterCriteria($filter): CriteriaCompo
    {
        $parts    = \explode('|', $filter);
        $criteria = new CriteriaCompo();
        foreach ($parts as $part) {
Severity: Minor
Found in class/ArtistsHandler.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 getFilterCriteria has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFilterCriteria($filter): \CriteriaCompo
    {
        $parts    = \explode('|', $filter);
        $criteria = new \CriteriaCompo();
        foreach ($parts as $part) {
Severity: Minor
Found in class/VoiceHandler.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 render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

        public function upload($chmod = 0644): bool
        {
            if ('' == $this->uploadDir) {
                $this->setErrors('Upload directory not set');
    
    Severity: Minor
    Found in class/Uploader.php - About 1 hr to fix

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

          public function addVote($sid, $value): bool
          {
              $criteria = new CriteriaCompo(new Criteria('sid', $sid));
      
              $ip = Utility::getIPData(false);
      Severity: Minor
      Found in class/VotesHandler.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 getFilterURLComponents has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getFilterURLComponents($filter, $field, $sort = 'created'): array
          {
              $parts     = \explode('|', $filter);
              $ret       = [];
              $value     = '';
      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 toXml has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function toXml($array, $name, $standalone, $beginning, $nested): string
          {
              $output = '';
              if ($beginning) {
                  if ($standalone) {
      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 isBlockCloned has a Cognitive Complexity of 12 (exceeds 5 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: Minor
      Found in class/Common/Blocksadmin.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 toXml has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function toXml($array, $name, $standalone, $beginning, $nested): string
          {
              $output = '';
              if ($beginning) {
                  if ($standalone) {
      Severity: Minor
      Found in class/Utility.php - About 1 hr to fix

        Method fetchMedia has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function fetchMedia($index_name, $index = null): bool
            {
                if (!isset($_FILES[$index_name])) {
                    $this->setErrors('File not found');
        
        Severity: Minor
        Found in class/Uploader.php - About 1 hr to fix

          Method orderBlock has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function orderBlock(
                  array $bid,
                  array $oldtitle,
                  array $oldside,
                  array $oldweight,
          Severity: Minor
          Found in class/Common/Blocksadmin.php - About 1 hr to fix

            Method __construct has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function __construct($caption, $name, $value = null, $size = 1, $multiple = false, $id = -1, $field = 'cid')
                {
                    global $_form_object_options;
                    \xoops_loadLanguage('modinfo', 'songlist');
            
            
            Severity: Minor
            Found in class/Form/SelectSongForm.php - About 1 hr to fix

              Method getURL has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getURL(): string
                  {
                      global $file, $op, $fct, $id, $value, $gid, $vid, $cid, $start, $limit;
                      if ($GLOBALS['songlistModuleConfig']['htaccess']) {
                          if (0 != $cid) {
              Severity: Minor
              Found in class/AlbumsHandler.php - About 1 hr to fix

                Method getURL has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getURL(): string
                    {
                        global $file, $op, $fct, $id, $value, $gid, $vid, $vcid, $cid, $start, $limit;
                        if ($GLOBALS['songlistModuleConfig']['htaccess']) {
                            if (0 != $cid) {
                Severity: Minor
                Found in class/SongsHandler.php - About 1 hr to fix

                  Method getURL has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getURL(): string
                      {
                          global $file, $op, $fct, $id, $value, $gid, $vid, $cid, $start, $limit;
                          if ($GLOBALS['songlistModuleConfig']['htaccess']) {
                              if (0 != $cid) {
                  Severity: Minor
                  Found in class/ArtistsHandler.php - About 1 hr to fix

                    Method createLogo has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function createLogo($dirname): bool
                        {
                            if (!\extension_loaded('gd')) {
                                return false;
                            }
                    Severity: Minor
                    Found in class/Common/Cloner.php - About 1 hr to fix

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

                          public function cloneBlock(int $bid): void
                          {
                              //require __DIR__ . '/admin_header.php';
                              //        \xoops_cp_header();
                      
                      
                      Severity: Minor
                      Found in class/Common/Blocksadmin.php - About 1 hr to fix

                        Method _renderOptionTree has 32 lines of code (exceeds 25 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 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language