VinaBB/VinaBB.vn

View on GitHub

Showing 237 of 644 total issues

Function main has a Cognitive Complexity of 462 (exceeds 5 allowed). Consider refactoring.
Open

    public function main($forum_id, $topic_id, $page)
    {
        global $_SID, $_EXTRA_URL;

        // Common functions
Severity: Minor
Found in ext/vinabb/web/controllers/board/topic.php - About 1 wk 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 main has 1394 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function main($forum_id, $topic_id, $page)
    {
        global $_SID, $_EXTRA_URL;

        // Common functions
Severity: Major
Found in ext/vinabb/web/controllers/board/topic.php - About 6 days to fix

    File topic.php has 1506 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
    * This file is part of the VinaBB.vn package.
    *
    * @copyright (c) VinaBB <vinabb.vn>
    Severity: Major
    Found in ext/vinabb/web/controllers/board/topic.php - About 4 days to fix

      Function main has a Cognitive Complexity of 154 (exceeds 5 allowed). Consider refactoring.
      Open

          public function main($mode, $page)
          {
              include "{$this->root_path}includes/functions_display.{$this->php_ext}";
      
              // Language
      Severity: Minor
      Found in ext/vinabb/web/controllers/user/user.php - About 3 days 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 main has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
      Open

          public function main($forum_id, $page)
          {
              global $_SID, $_EXTRA_URL;
      
              // Common functions
      Severity: Minor
      Found in ext/vinabb/web/controllers/board/forum.php - About 2 days 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 main has 539 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function main($mode, $page)
          {
              include "{$this->root_path}includes/functions_display.{$this->php_ext}";
      
              // Language
      Severity: Major
      Found in ext/vinabb/web/controllers/user/user.php - About 2 days to fix

        Method main has 498 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function main($forum_id, $page)
            {
                global $_SID, $_EXTRA_URL;
        
                // Common functions
        Severity: Major
        Found in ext/vinabb/web/controllers/board/forum.php - About 2 days to fix

          Function main has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring.
          Open

              public function main($mode)
              {
                  // Language
                  $this->language->add_lang('memberlist');
          
          
          Severity: Minor
          Found in ext/vinabb/web/controllers/user/online.php - About 1 day 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

          File forum.php has 695 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
          * This file is part of the VinaBB.vn package.
          *
          * @copyright (c) VinaBB <vinabb.vn>
          Severity: Major
          Found in ext/vinabb/web/controllers/board/forum.php - About 1 day to fix

            Function check_group_settings has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function check_group_settings($group_name = 'main')
                {
                    foreach ($this->{'list_' . $group_name . '_settings'}() as $group_name => $group_data)
                    {
                        foreach ($group_data as $name => $data)
            Severity: Minor
            Found in ext/vinabb/web/controllers/acp/helper/setting_helper.php - About 1 day 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

            File user.php has 591 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
            * This file is part of the VinaBB.vn package.
            *
            * @copyright (c) VinaBB <vinabb.vn>
            Severity: Major
            Found in ext/vinabb/web/controllers/user/user.php - About 1 day to fix

              Function assign_tpl_vars has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function assign_tpl_vars($module_url)
                  {
                      global $template;
              
                      $current_id = $right_id = false;
              Severity: Minor
              Found in ext/vinabb/web/includes/p_master.php - About 1 day 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 main has 181 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function main($mode)
                  {
                      // Language
                      $this->language->add_lang('memberlist');
              
              
              Severity: Major
              Found in ext/vinabb/web/controllers/user/online.php - About 7 hrs to fix

                Method display has 139 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function display()
                    {
                        // Breadcrumb
                        $this->template->assign_block_vars('breadcrumb', [
                            'NAME'    => $this->language->lang('FAQ_EXPLAIN')
                Severity: Major
                Found in ext/vinabb/web/decorates/help/controller/faq.php - About 5 hrs to fix

                  Function main has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function main()
                      {
                          include "{$this->root_path}includes/functions_display.{$this->php_ext}";
                          include "{$this->root_path}includes/functions_user.{$this->php_ext}";
                  
                  
                  Severity: Minor
                  Found in ext/vinabb/web/controllers/user/team.php - About 5 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

                  File bb_item_versions.php has 389 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                  * This file is part of the VinaBB.vn package.
                  *
                  * @copyright (c) VinaBB <vinabb.vn>
                  Severity: Minor
                  Found in ext/vinabb/web/controllers/acp/bb_item_versions.php - About 5 hrs to fix

                    Method main has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function main()
                        {
                            include "{$this->root_path}includes/functions_display.{$this->php_ext}";
                            include "{$this->root_path}includes/functions_user.{$this->php_ext}";
                    
                    
                    Severity: Major
                    Found in ext/vinabb/web/controllers/user/team.php - About 5 hrs to fix

                      File article.php has 360 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                      * This file is part of the VinaBB.vn package.
                      *
                      * @copyright (c) VinaBB <vinabb.vn>
                      Severity: Minor
                      Found in ext/vinabb/web/controllers/portal/article.php - About 4 hrs to fix

                        File menus.php has 354 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                        * This file is part of the VinaBB.vn package.
                        *
                        * @copyright (c) VinaBB <vinabb.vn>
                        Severity: Minor
                        Found in ext/vinabb/web/controllers/acp/menus.php - About 4 hrs to fix

                          helper has 34 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class helper implements helper_interface
                          {
                              /** @var ContainerInterface $container */
                              protected $container;
                          
                          
                          Severity: Minor
                          Found in ext/vinabb/web/entities/helper/helper.php - About 4 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language