BitPrepared/dreamland-portal

View on GitHub

Showing 108 of 108 total issues

Method registration has 512 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function registration($app)
{
    // Library group
    $app->group('/registrazione', function () use ($app) {

Severity: Major
Found in includes/api/registration.php - About 2 days to fix

    Method sfide has 482 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function sfide($app)
    {
        $app->group('/sfide', function () use ($app) {
    
            $app->get('/:id', function ($sfida_id) use ($app) {
    Severity: Major
    Found in includes/api/sfide.php - About 2 days to fix

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

                  try {
                      if (!isset($_SESSION['wordpress'])) {
                          throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                      }
      
      
      Severity: Major
      Found in includes/api/sfide.php and 3 other locations - About 1 day to fix
      includes/api/sfide.php on lines 198..334
      includes/api/sfide.php on lines 347..427
      includes/api/sfide.php on lines 548..605

      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 303.

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

                  try {
                      if (!isset($_SESSION['wordpress'])) {
                          throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                      }
      
      
      Severity: Major
      Found in includes/api/sfide.php and 3 other locations - About 1 day to fix
      includes/api/sfide.php on lines 198..334
      includes/api/sfide.php on lines 347..427
      includes/api/sfide.php on lines 445..539

      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 303.

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

                  try {
                      if (!isset($_SESSION['wordpress'])) {
                          throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                      }
      
      
      Severity: Major
      Found in includes/api/sfide.php and 3 other locations - About 1 day to fix
      includes/api/sfide.php on lines 198..334
      includes/api/sfide.php on lines 445..539
      includes/api/sfide.php on lines 548..605

      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 303.

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

                  try {
                      if (!isset($_SESSION['wordpress'])) {
                          throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                      }
      
      
      Severity: Major
      Found in includes/api/sfide.php and 3 other locations - About 1 day to fix
      includes/api/sfide.php on lines 347..427
      includes/api/sfide.php on lines 445..539
      includes/api/sfide.php on lines 548..605

      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 303.

      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

      File registration.php has 519 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      use Dreamland\Errori;
      use Dreamland\Ruoli;
      use RedBean_Facade as R;
      Severity: Major
      Found in includes/api/registration.php - About 1 day to fix

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

                    try {
                        if (!isset($_SESSION['wordpress'])) {
                            throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                        }
        
        
        Severity: Major
        Found in includes/api/sfide.php and 2 other locations - About 1 day to fix
        includes/api/editor.php on lines 19..99
        includes/api/editor.php on lines 105..197

        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 248.

        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 3 locations. Consider refactoring.
        Open

                    try {
                        if (!isset($_SESSION['wordpress'])) {
                            throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                        }
        
        
        Severity: Major
        Found in includes/api/editor.php and 2 other locations - About 1 day to fix
        includes/api/editor.php on lines 19..99
        includes/api/sfide.php on lines 86..179

        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 248.

        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 3 locations. Consider refactoring.
        Open

                    try {
                        if (!isset($_SESSION['wordpress'])) {
                            throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                        }
        
        
        Severity: Major
        Found in includes/api/editor.php and 2 other locations - About 1 day to fix
        includes/api/editor.php on lines 105..197
        includes/api/sfide.php on lines 86..179

        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 248.

        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

        File sfide.php has 492 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        use BitPrepared\Event\EventElement;
        use BitPrepared\Event\EventManager;
        use Dreamland\Errori;
        Severity: Minor
        Found in includes/api/sfide.php - About 7 hrs to fix

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

                      try {
                          if (!isset($_SESSION['wordpress'])) {
                              throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                          }
          
          
          Severity: Major
          Found in includes/api/squadriglia.php and 1 other location - About 7 hrs to fix
          includes/api/squadriglia.php on lines 137..196

          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 239.

          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

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

                      try {
                          if (!isset($_SESSION['wordpress'])) {
                              throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                          }
          
          
          Severity: Major
          Found in includes/api/squadriglia.php and 1 other location - About 7 hrs to fix
          includes/api/squadriglia.php on lines 72..128

          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 239.

          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 squadriglia has 168 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function squadriglia($app)
          {
              $app->group('/squadriglia', function () use ($app) {
          
                  $app->get('/', function () use ($app) {
          Severity: Major
          Found in includes/api/squadriglia.php - About 6 hrs to fix

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

                        try {
                            if (!isset($_SESSION['wordpress'])) {
                                throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                            }
            
            
            Severity: Major
            Found in includes/api/sfide.php and 1 other location - About 6 hrs to fix
            includes/api/squadriglia.php on lines 14..63

            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 216.

            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

                        try {
                            if (!isset($_SESSION['wordpress'])) {
                                throw new Exception('Wordpress login not found', Errori::WORDPRESS_LOGIN_REQUIRED);
                            }
            
            
            Severity: Major
            Found in includes/api/squadriglia.php and 1 other location - About 6 hrs to fix
            includes/api/sfide.php on lines 17..78

            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 216.

            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 editor has 157 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function editor($app)
            {
                // Library group
                $app->group('/editor', function () use ($app) {
            
            
            Severity: Major
            Found in includes/api/editor.php - About 6 hrs to fix

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

              function livello($livelloArrayA, $livelloArrayB, $livelloArrayC, $stelleAssoc)
              {
                  ?>
              <div class="container">
              
              
              Severity: Major
              Found in resources/templates/production/ordini/list.php and 1 other location - About 5 hrs to fix
              resources/templates/production/ordini/dream.php on lines 25..80

              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 201.

              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

              function livello($livelloArrayA, $livelloArrayB, $livelloArrayC, $stelleAssoc)
              {
                  ?>
              <div class="container">
              
              
              Severity: Major
              Found in resources/templates/production/ordini/dream.php and 1 other location - About 5 hrs to fix
              resources/templates/production/ordini/list.php on lines 25..80

              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 201.

              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

                      $scope.creaEG = function() {
                          var gruppo = {};
                          gruppo.gruppo = $scope.gruppo;
                          $http.post('./api/editor/eg',gruppo).
                              success(function(data, status, headers, config) {
              Severity: Major
              Found in public/app/Editor/EditorController.js and 1 other location - About 5 hrs to fix
              public/app/Editor/EditorController.js on lines 31..45

              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 152.

              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