Showing 32 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

    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_graid';
                          $this->_a['verbose'] = 'ELearn_Graid';
                          $this->_a['cols'] = array(
                  Severity: Minor
                  Found in src/ELearn/Grade.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 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

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

                            function filter()
                            {
                                if (strlen($this->where_clause) > 0) {
                                    return $this->where_clause;
                                }
                        Severity: Minor
                        Found in src/ELearn/Searcher.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 find has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function find($request, $match)
                            {
                                // check for domain
                                if (isset($match['domainId'])) {
                                    $domainId = $match['domainId'];
                        Severity: Minor
                        Found in src/ELearn/Views/Topic.php - About 1 hr to fix

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

                              public static function find($request, $match)
                              {
                                  // check for course
                                  if (isset($match['courseId'])) {
                                      $courseId = $match['courseId'];
                          Severity: Minor
                          Found in src/ELearn/Views/Lesson.php - About 1 hr to fix

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

                                public static function find($request, $match)
                                {
                                    // check for topic
                                    if (isset($match['topicId'])) {
                                        $topicId = $match['topicId'];
                            Severity: Minor
                            Found in src/ELearn/Views/Course.php - About 1 hr to fix

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

                                  public static function findAll($request, $match)
                                  {
                                      // check for domain
                                      if (isset($match['domainId'])) {
                                          $domainId = $match['domainId'];
                              Severity: Minor
                              Found in src/ELearn/Views/Topic.php - About 1 hr to fix

                                Function remove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public static function remove($request, $match)
                                    {
                                        if (isset($match['lessonId'])) {
                                            $lessonId = $match['lessonId'];
                                        } else {
                                Severity: Minor
                                Found in src/ELearn/Views/Lesson.php - About 55 mins 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 remove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public static function remove($request, $match)
                                    {
                                        if (isset($match['courseId'])) {
                                            $courseId = $match['courseId'];
                                        } else {
                                Severity: Minor
                                Found in src/ELearn/Views/Course.php - About 55 mins 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 remove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public static function remove($request, $match)
                                    {
                                        // Check and fetch Part
                                        if (isset($match['partId'])) {
                                            $partId = $match['partId'];
                                Severity: Minor
                                Found in src/ELearn/Views/Part.php - About 55 mins 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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public static function get($request, $match)
                                    {
                                        // Check and fetch Part
                                        if (array_key_exists('partId', $match)) {
                                            $part = Pluf_Shortcuts_GetObjectOr404('ELearn_Part', $match['partId']);
                                Severity: Minor
                                Found in src/ELearn/Views/Part.php - About 55 mins 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