mambax7/songlist

View on GitHub

Showing 3,642 of 3,642 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                case 'radio':
                    $valuetypes = [
                        \XOBJ_DTYPE_ARRAY   => \_FRM_SONGLIST_FIELDS_ARRAY,
                        \XOBJ_DTYPE_EMAIL   => \_FRM_SONGLIST_FIELDS_EMAIL,
                        \XOBJ_DTYPE_INT     => \_FRM_SONGLIST_FIELDS_INT,
Severity: Major
Found in class/Form/FormController.php and 1 other location - About 4 hrs to fix
class/Form/FormController.php on lines 92..108

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 162.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

                                    if (mb_strlen($_POST['category']) > 0 && !empty($data[$_POST['category']])) {
                                        $criteria = new \Criteria('name', $data[$_POST['category']]);
                                        if ($categoryHandler->getCount($criteria) > 0) {
                                            $objects = $categoryHandler->getObjects($criteria, false);
                                            $cid     = $objects[0]->getVar('cid');
        Severity: Major
        Found in admin/export.php and 5 other locations - About 3 hrs to fix
        admin/export.php on lines 112..122
        admin/export.php on lines 125..135
        admin/export.php on lines 210..220
        admin/export.php on lines 222..232
        admin/export.php on lines 234..244

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

                                if (mb_strlen($_POST['voice']) > 0 && !empty($data[$_POST['voice']])) {
                                    $criteria = new \Criteria('name', $data[$_POST['voice']]);
                                    if ($voiceHandler->getCount($criteria) > 0) {
                                        $objects = $voiceHandler->getObjects($criteria, false);
                                        $gid     = $objects[0]->getVar('vid');
        Severity: Major
        Found in admin/export.php and 5 other locations - About 3 hrs to fix
        admin/export.php on lines 112..122
        admin/export.php on lines 125..135
        admin/export.php on lines 138..148
        admin/export.php on lines 210..220
        admin/export.php on lines 234..244

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

                                    if (mb_strlen($_POST['genre']) > 0 && !empty($data[$_POST['genre']])) {
                                        $criteria = new \Criteria('name', $data[$_POST['genre']]);
                                        if ($genreHandler->getCount($criteria) > 0) {
                                            $objects = $genreHandler->getObjects($criteria, false);
                                            $gid     = $objects[0]->getVar('gid');
        Severity: Major
        Found in admin/export.php and 5 other locations - About 3 hrs to fix
        admin/export.php on lines 125..135
        admin/export.php on lines 138..148
        admin/export.php on lines 210..220
        admin/export.php on lines 222..232
        admin/export.php on lines 234..244

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

                                    if (mb_strlen($_POST['voice']) > 0 && !empty($data[$_POST['voice']])) {
                                        $criteria = new \Criteria('name', $data[$_POST['voice']]);
                                        if ($voiceHandler->getCount($criteria) > 0) {
                                            $objects = $voiceHandler->getObjects($criteria, false);
                                            $gid     = $objects[0]->getVar('vid');
        Severity: Major
        Found in admin/export.php and 5 other locations - About 3 hrs to fix
        admin/export.php on lines 112..122
        admin/export.php on lines 138..148
        admin/export.php on lines 210..220
        admin/export.php on lines 222..232
        admin/export.php on lines 234..244

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

                                if (mb_strlen($_POST['genre']) > 0 && !empty($data[$_POST['genre']])) {
                                    $criteria = new \Criteria('name', $data[$_POST['genre']]);
                                    if ($genreHandler->getCount($criteria) > 0) {
                                        $objects = $genreHandler->getObjects($criteria, false);
                                        $gid     = $objects[0]->getVar('gid');
        Severity: Major
        Found in admin/export.php and 5 other locations - About 3 hrs to fix
        admin/export.php on lines 112..122
        admin/export.php on lines 125..135
        admin/export.php on lines 138..148
        admin/export.php on lines 222..232
        admin/export.php on lines 234..244

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

                                if (mb_strlen($_POST['category']) > 0 && !empty($data[$_POST['category']])) {
                                    $criteria = new \Criteria('name', $data[$_POST['category']]);
                                    if ($categoryHandler->getCount($criteria) > 0) {
                                        $objects = $categoryHandler->getObjects($criteria, false);
                                        $cid     = $objects[0]->getVar('cid');
        Severity: Major
        Found in admin/export.php and 5 other locations - About 3 hrs to fix
        admin/export.php on lines 112..122
        admin/export.php on lines 125..135
        admin/export.php on lines 138..148
        admin/export.php on lines 210..220
        admin/export.php on lines 222..232

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 158.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          if (\is_object($album)) {
                              $album->setVar('songs', $album->getVar('songs') + 1);
                              $albumsHandler->insert($album, true, $obj);
                              if (true === $new || (0 != $obj->vars['vcid']['value'])) {
                                  $voice = $voiceHandler->get($obj->vars['vcid']['value']);
          Severity: Major
          Found in class/SongsHandler.php and 1 other location - About 3 hrs to fix
          class/SongsHandler.php on lines 185..195

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 157.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                                  if (\is_object($artists)) {
                                      $artists->setVar('songs', $artists->getVar('songs') - 1);
                                      $artistsHandler->insert($artists, true, null);
                                      if (!$old->isNew() && $old->getVar('vcid') > 0) {
                                          $voice = $voiceHandler->get($old->vars['vcid']['value']);
          Severity: Major
          Found in class/SongsHandler.php and 1 other location - About 3 hrs to fix
          class/SongsHandler.php on lines 236..246

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 157.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                                  if (\is_object($artists)) {
                                      $artists->setVar('songs', $artists->getVar('songs') + 1);
                                      $artistsHandler->insert($artists, true, $obj);
                                      if (true === $new || (0 != $obj->vars['vcid']['value'])) {
                                          $voice = $voiceHandler->get($obj->vars['vcid']['value']);
          Severity: Major
          Found in class/SongsHandler.php and 1 other location - About 3 hrs to fix
          class/SongsHandler.php on lines 222..232

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 157.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          if (\is_object($album)) {
                              $album->setVar('songs', $album->getVar('songs') - 1);
                              $albumsHandler->insert($album, true, null);
                              if (!$old->isNew() && $old->getVar('vcid') > 0) {
                                  $voice = $voiceHandler->get($old->vars['vcid']['value']);
          Severity: Major
          Found in class/SongsHandler.php and 1 other location - About 3 hrs to fix
          class/SongsHandler.php on lines 203..213

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 157.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

                      case 'abid':
                          if ('albums' !== $op) {
                              $ele = new SelectAlbumForm('', 'filter_' . $field . '', $components['value'], 1, false);
                              $ele->setExtra(
                                  'onchange="window.open(\''
          Severity: Major
          Found in class/Utility.php and 5 other locations - About 3 hrs to fix
          class/Utility.php on lines 319..338
          class/Utility.php on lines 339..358
          class/Utility.php on lines 359..378
          class/Utility.php on lines 417..436
          class/Utility.php on lines 437..456

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 156.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

                      case 'sid':
                          if ('songs' !== $op) {
                              $ele = new SelectSongForm('', 'filter_' . $field . '', $components['value'], 1, false);
                              $ele->setExtra(
                                  'onchange="window.open(\''
          Severity: Major
          Found in class/Utility.php and 5 other locations - About 3 hrs to fix
          class/Utility.php on lines 319..338
          class/Utility.php on lines 339..358
          class/Utility.php on lines 359..378
          class/Utility.php on lines 397..416
          class/Utility.php on lines 417..436

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 156.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

                      case 'gid':
                          if ('genre' !== $op) {
                              $ele = new SelectGenreForm('', 'filter_' . $field . '', $components['value'], 1, false);
                              $ele->setExtra(
                                  'onchange="window.open(\''
          Severity: Major
          Found in class/Utility.php and 5 other locations - About 3 hrs to fix
          class/Utility.php on lines 339..358
          class/Utility.php on lines 359..378
          class/Utility.php on lines 397..416
          class/Utility.php on lines 417..436
          class/Utility.php on lines 437..456

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 156.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 6 locations. Consider refactoring.
          Open

                      case 'vcid':
                          if ('voice' !== $op) {
                              $ele = new SelectVoiceForm('', 'filter_' . $field . '', $components['value'], 1, false);
                              $ele->setExtra(
                                  'onchange="window.open(\''
          Severity: Major
          Found in class/Utility.php and 5 other locations - About 3 hrs to fix
          class/Utility.php on lines 319..338
          class/Utility.php on lines 359..378
          class/Utility.php on lines 397..416
          class/Utility.php on lines 417..436
          class/Utility.php on lines 437..456

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 156.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language