CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/CommentTracker/ManageComments.php

Summary

Maintainability
F
4 days
Test Coverage

File ManageComments.php has 597 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use COREPOS\Fannie\API\data\pipes\OutgoingEmail;

include(__DIR__ . '/../../../config.php');
Severity: Major
Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 1 day to fix

    Method get_id_view has 156 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function get_id_view()
        {
            $settings = $this->config->get('PLUGIN_SETTINGS');
            $prefix = $settings['CommentDB'] . $this->connection->sep();
    
    
    Severity: Major
    Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 6 hrs to fix

      Method get_view has 111 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function get_view()
          {
              $settings = $this->config->get('PLUGIN_SETTINGS');
              $prefix = $settings['CommentDB'] . $this->connection->sep();
      
      
      Severity: Major
      Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 4 hrs to fix

        Method post_new_handler has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function post_new_handler()
            {
                $uid = FannieAuth::getUID();
                $cardno = trim(FormLib::get('cardno'));
                $name = trim(FormLib::get('name'));
        Severity: Minor
        Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 2 hrs to fix

          Method get_new_view has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function get_new_view()
              {
                  $settings = $this->config->get('PLUGIN_SETTINGS');
                  $categories = new CategoriesModel($this->connection);
                  $categories->whichDB($settings['CommentDB']);
          Severity: Minor
          Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 1 hr to fix

            Method post_id_handler has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function post_id_handler()
                {
                    $uid = FannieAuth::getUID();
                    $settings = $this->config->get('PLUGIN_SETTINGS');
                    $this->connection->selectDB($settings['CommentDB']);
            Severity: Minor
            Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 1 hr to fix

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

                  protected function get_view()
                  {
                      $settings = $this->config->get('PLUGIN_SETTINGS');
                      $prefix = $settings['CommentDB'] . $this->connection->sep();
              
              
              Severity: Minor
              Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.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 post_id_catID_handler has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function post_id_catID_handler()
                  {
                      $uid = FannieAuth::getUID();
                      $settings = $this->config->get('PLUGIN_SETTINGS');
                      $this->connection->selectDB($settings['CommentDB']);
              Severity: Minor
              Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 1 hr to fix

                Method post_id_tags_handler has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function post_id_tags_handler()
                    {
                        $settings = $this->config->get('PLUGIN_SETTINGS');
                        $this->connection->selectDB($settings['CommentDB']);
                        $tags = trim($this->tags);
                Severity: Minor
                Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 1 hr to fix

                  Function post_new_handler has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function post_new_handler()
                      {
                          $uid = FannieAuth::getUID();
                          $cardno = trim(FormLib::get('cardno'));
                          $name = trim(FormLib::get('name'));
                  Severity: Minor
                  Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                      protected function get_id_view()
                      {
                          $settings = $this->config->get('PLUGIN_SETTINGS');
                          $prefix = $settings['CommentDB'] . $this->connection->sep();
                  
                  
                  Severity: Minor
                  Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.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 post_id_tags_handler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function post_id_tags_handler()
                      {
                          $settings = $this->config->get('PLUGIN_SETTINGS');
                          $this->connection->selectDB($settings['CommentDB']);
                          $tags = trim($this->tags);
                  Severity: Minor
                  Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 35 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 post_id_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function post_id_handler()
                      {
                          $uid = FannieAuth::getUID();
                          $settings = $this->config->get('PLUGIN_SETTINGS');
                          $this->connection->selectDB($settings['CommentDB']);
                  Severity: Minor
                  Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.php - About 25 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

                  There are no issues that match your filters.

                  Category
                  Status