mambax7/songlist

View on GitHub

Showing 264 of 3,642 total issues

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

    Method saveField has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function saveField($vars, $weight = 0): string
        {
            $field = $this->createField();
            $field->setVar('field_name', $vars['name']);
            $field->setVar('field_valuetype', $vars['valuetype']);
    Severity: Minor
    Found in class/ExtrasHandler.php - About 1 hr to fix

      Function getIPData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getIPData($ip = false): array
          {
              $ret = [];
              if (\is_object($GLOBALS['xoopsUser'])) {
                  $ret['uid']   = $GLOBALS['xoopsUser']->getVar('uid');
      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 checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
          {
              $moduleDirName      = \basename(\dirname(__DIR__, 2));
              $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
              $update             = '';
      Severity: Minor
      Found in class/Utility.php - About 1 hr to fix

        Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function checkVerModule(\Xmf\Module\Helper $helper, ?string $source = 'github', ?string $default = 'master'): ?array
            {
                $moduleDirName      = \basename(\dirname(__DIR__, 2));
                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
                $update             = '';
        Severity: Minor
        Found in class/Common/VersionChecks.php - About 1 hr to fix

          Method updateBlock has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
              {
                  $myblock = new \XoopsBlock($bid);
                  $myblock->setVar('title', $btitle);
                  $myblock->setVar('weight', $bweight);
          Severity: Minor
          Found in class/Common/Blocksadmin.php - About 1 hr to fix

            Method xoops_module_update_songlist has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function xoops_module_update_songlist(\XoopsModule $module, $previousVersion = null): bool
            {
                $moduleDirName      = \basename(\dirname(__DIR__));
                $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
            
            
            Severity: Minor
            Found in include/onupdate.php - About 1 hr to fix

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

                  public static function  getFormGenre($object, $as_array = false)
                  {
                      if (!\is_object($object)) {
                          $handler = Helper::getInstance()
                                           ->getHandler('Genre');
              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 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/SongsHandler.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 __construct has a Cognitive Complexity of 13 (exceeds 5 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

              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/RequestsHandler.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 getFormVoice has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function  getFormVoice($object, $as_array = false)
                  {
                      if (!\is_object($object)) {
                          $handler = Helper::getInstance()
                                           ->getHandler('Voice');
              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 getFormArtists has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function  getFormArtists($object, $as_array = false)
                  {
                      if (!\is_object($object)) {
                          $handler = Helper::getInstance()
                                           ->getHandler('Artists');
              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 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/AlbumsHandler.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 loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

              function loadTableFromArrayWithReplace($table, $data, $search, $replace): int
              {
                  /** @var \XoopsMySQLDatabase $db */
                  $db = \XoopsDatabaseFactory::getDatabaseConnection();
              
              
              Severity: Minor
              Found in testdata/index.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/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 getFormUtf8map has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function  getFormUtf8map($object, $as_array = false)
                  {
                      if (!\is_object($object)) {
                          $handler = Helper::getInstance()
                                           ->getHandler('Utf8map');
              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 saveField has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function saveField($vars, $weight = 0): string
                  {
                      $field = $this->createField();
                      $field->setVar('field_name', $vars['name']);
                      $field->setVar('field_valuetype', $vars['valuetype']);
              Severity: Minor
              Found in class/ExtrasHandler.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/Utf8mapHandler.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/GenreHandler.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

              Severity
              Category
              Status
              Source
              Language