Showing 910 of 910 total issues

File urls.php has 570 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
return array(
    // ************************************************************* Domain
    array( // Create
        'regex' => '#^/domain/new$#',
Severity: Major
Found in src/ELearn/urls.php - About 1 day to fix

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

        public static function remove($request, $match)
        {
            if (isset($match['topicId'])) {
                $topicId = $match['topicId'];
            } else {
    Severity: Major
    Found in src/ELearn/Views/Topic.php and 2 other locations - About 6 hrs to fix
    src/ELearn/Views/Course.php on lines 97..120
    src/ELearn/Views/Lesson.php on lines 97..120

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

    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

        public static function remove($request, $match)
        {
            if (isset($match['courseId'])) {
                $courseId = $match['courseId'];
            } else {
    Severity: Major
    Found in src/ELearn/Views/Course.php and 2 other locations - About 6 hrs to fix
    src/ELearn/Views/Lesson.php on lines 97..120
    src/ELearn/Views/Topic.php on lines 144..167

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

    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

        public static function remove($request, $match)
        {
            if (isset($match['lessonId'])) {
                $lessonId = $match['lessonId'];
            } else {
    Severity: Major
    Found in src/ELearn/Views/Lesson.php and 2 other locations - About 6 hrs to fix
    src/ELearn/Views/Course.php on lines 97..120
    src/ELearn/Views/Topic.php on lines 144..167

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

    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

        public static function update($request, $match, $p)
        {
            $lesson = Pluf_Shortcuts_GetObjectOr404('ELearn_Lesson', $match['modelId']);
            // check course
            if (isset($match['courseId'])) {
    Severity: Major
    Found in src/ELearn/Views/Lesson.php and 2 other locations - About 5 hrs to fix
    src/ELearn/Views/Course.php on lines 122..141
    src/ELearn/Views/Topic.php on lines 169..188

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

    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

        public static function update($request, $match, $p)
        {
            $topic = Pluf_Shortcuts_GetObjectOr404('ELearn_Topic', $match['modelId']);
            // check domain
            if (isset($match['domainId'])) {
    Severity: Major
    Found in src/ELearn/Views/Topic.php and 2 other locations - About 5 hrs to fix
    src/ELearn/Views/Course.php on lines 122..141
    src/ELearn/Views/Lesson.php on lines 122..140

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

    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

        public static function update($request, $match, $p)
        {
            $course = Pluf_Shortcuts_GetObjectOr404('ELearn_Course', $match['modelId']);
            // check topic
            if (isset($match['topicId'])) {
    Severity: Major
    Found in src/ELearn/Views/Course.php and 2 other locations - About 5 hrs to fix
    src/ELearn/Views/Lesson.php on lines 122..140
    src/ELearn/Views/Topic.php on lines 169..188

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

    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

        public static function get($request, $match)
        {
            $lesson = Pluf_Shortcuts_GetObjectOr404('ELearn_Lesson', $match['lessonId']);
            // check course if is set
            if (isset($match['courseId'])) {
    Severity: Major
    Found in src/ELearn/Views/Lesson.php and 2 other locations - About 3 hrs to fix
    src/ELearn/Views/Course.php on lines 33..49
    src/ELearn/Views/Topic.php on lines 34..49

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

    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

        public static function get($request, $match)
        {
            $course = Pluf_Shortcuts_GetObjectOr404('ELearn_Course', $match['courseId']);
            // check topic
            if (isset($match['topicId'])) {
    Severity: Major
    Found in src/ELearn/Views/Course.php and 2 other locations - About 3 hrs to fix
    src/ELearn/Views/Lesson.php on lines 33..49
    src/ELearn/Views/Topic.php on lines 34..49

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

    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

        public static function get($request, $match)
        {
            $topic = Pluf_Shortcuts_GetObjectOr404('ELearn_Topic', $match['topicId']);
            if (isset($match['domainId'])) {
                $domainId = $match['domainId'];
    Severity: Major
    Found in src/ELearn/Views/Topic.php and 2 other locations - About 3 hrs to fix
    src/ELearn/Views/Course.php on lines 33..49
    src/ELearn/Views/Lesson.php on lines 33..49

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

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

        function init()
        {
            $this->_a['table'] = 'elearn_part';
            $this->_a['verbose'] = 'ELearn_Part';
            $this->_a['cols'] = array(
    Severity: Major
    Found in src/ELearn/Part.php - About 3 hrs to fix

      Method init has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function init()
          {
              $this->_a['table'] = 'elearn_comment';
              $this->_a['verbose'] = 'ELearn_Comment';
              $this->_a['cols'] = array(
      Severity: Major
      Found in src/ELearn/Comment.php - About 2 hrs to fix

        Method init has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function init()
            {
                $this->_a['table'] = 'elearn_topic';
                $this->_a['verbose'] = 'ELearn_Topic';
                $this->_a['cols'] = array(
        Severity: Major
        Found in src/ELearn/Topic.php - About 2 hrs to fix

          Method init has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function init()
              {
                  $this->_a['table'] = 'elearn_course';
                  $this->_a['verbose'] = 'ELearn_Course';
                  $this->_a['cols'] = array(
          Severity: Major
          Found in src/ELearn/Course.php - About 2 hrs to fix

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

                function init()
                {
                    $this->_a['table'] = 'elearn_vote';
                    $this->_a['verbose'] = 'ELearn_Vote';
                    $this->_a['cols'] = array(
            Severity: Major
            Found in src/ELearn/Vote.php - About 2 hrs to fix

              Method init has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function init()
                  {
                      $this->_a['table'] = 'elearn_lesson';
                      $this->_a['verbose'] = 'ELearn_Lesson';
                      $this->_a['cols'] = array(
              Severity: Major
              Found in src/ELearn/Lesson.php - About 2 hrs to fix

                Method init has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function init()
                    {
                        $this->_a['table'] = 'elearn_domain';
                        $this->_a['verbose'] = 'ELearn_Domain';
                        $this->_a['cols'] = array(
                Severity: Minor
                Found in src/ELearn/Domain.php - About 1 hr to fix

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

                      function init()
                      {
                          $this->_a['table'] = 'elearn_parthistory';
                          $this->_a['verbose'] = 'ELearn_PartHistory';
                          $this->_a['cols'] = array(
                  Severity: Minor
                  Found in src/ELearn/PartHistory.php - About 1 hr to fix

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

                        function init()
                        {
                            $this->_a['table'] = 'elearn_graid';
                            $this->_a['verbose'] = 'ELearn_Graid';
                            $this->_a['cols'] = array(
                    Severity: Minor
                    Found in src/ELearn/Grade.php - About 1 hr to fix

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

                          public static function find($request, $match)
                          {
                              // check for lesson
                              if (isset($match['lessonId'])) {
                                  $lessonId = $match['lessonId'];
                      Severity: Minor
                      Found in src/ELearn/Views/Part.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language