piotrpolak/pepiscms

View on GitHub

Showing 486 of 487 total issues

Method index has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function index()
    {
        /* Getting module name from class name */
        $module_name = strtolower(str_replace('Admin', '', __CLASS__));

    Method prepareReplacementTokens has 13 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private function prepareReplacementTokens($module_database_table_name,
                                                  $module_name,
                                                  $module_label,
                                                  $module_name_singular,
                                                  $definition_output,
    Severity: Major
    Found in pepiscms/modules/development/libraries/ModuleGenerator.php - About 1 hr to fix

      Function resizeText has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          resizeText: function (trigger) {
      
              $('#font_resize_bar a').removeClass('active');
              var fSizeCookie = readCookie('fSize');
      
      
      Severity: Minor
      Found in pepiscms/js/jquery.frontend.js - About 1 hr to fix

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

            public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
            {
                $data['name'] = 'customization';
        
                // List of the fields to be used, if no value is present for a given key
        Severity: Minor
        Found in pepiscms/application/controllers/admin/Setup.php - About 1 hr to fix

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

              public function do_setup()
              {
                  $view = $this->_get_view();
          
                  $module = $this->input->getParam('module');
          Severity: Minor
          Found in pepiscms/application/controllers/admin/Module.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 display has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function display($view = false, $display_header = true, $display_footer = true, $return = false)
              {
                  // Preventing from displaying the same page for several times
                  if ($this->already_displayed) {
                      return false;
          Severity: Minor
          Found in pepiscms/application/classes/ModuleAdminController.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 compile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function compile($pattern, $object_with_data, $keys_to_be_replaced = array())
              {
                  if (count($keys_to_be_replaced) == 0) {
                      preg_match_all('/{([a-z_0-9]+)}/', $pattern, $matches);
                      $keys_to_be_replaced = $matches[1];
          Severity: Minor
          Found in pepiscms/application/classes/PatternCompiler.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 _edit has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _edit($is_preview = false, $display_view = true)
              {
                  $forced_filters = $this->getForcedFilters();
                  $definition = $this->getDefinition();
          
          
          Severity: Minor
          Found in pepiscms/modules/crud/libraries/AdminCRUDController.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 dumpFile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function dumpFile($path, $array, $arrayName = 'lang')
              {
                  $contents = "<?php if(!defined('BASEPATH')) exit('No direct script access allowed');\n\n";
          
                  if (count($array) == 0) {
          Severity: Minor
          Found in pepiscms/modules/translator/libraries/LanguageHelper.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 getBasicFeed has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getBasicFeed($extra_param)
              {
                  $data = array();
          
                  $pattern = '/\[(?P<datetime>.*)\] (?P<logger>\w+).(?P<level>\w+): (?P<message>.*[^ ]+) (?P<context>[^ ]+) (?P<extra>[^ ]+)/';
          Severity: Minor
          Found in pepiscms/modules/symfony2_bridge/models/Symfony2_log_model.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 _fb_callback_make_filename_seo_friendly has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
              {
                  // List of the fields to be used, if no value is present for a given key
                  // then the key will be ignored. By default all values of the keys
                  // specified will be concatenated
          Severity: Minor
          Found in pepiscms/modules/pages/controllers/PagesAdmin.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 parsePolicy has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function parsePolicy($path)
              {
                  if (!file_exists($path)) {
                      return false;
                  }
          Severity: Minor
          Found in pepiscms/application/libraries/SecurityPolicy.php - About 1 hr to fix

            Method getFieldDefaults has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getFieldDefaults()
                {
                    $defaults = array();
                    $defaults['field'] = false; // Field name
                    $defaults['label'] = false; // Field label
            Severity: Minor
            Found in pepiscms/application/libraries/DataGrid.php - About 1 hr to fix

              Method edit has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function edit()
                  {
                      $module = $this->input->getParam('module');
                      $language = $this->input->getParam('language');
                      $key = $this->input->getParam('key');
              Severity: Minor
              Found in pepiscms/modules/translator/controllers/TranslatorAdmin.php - About 1 hr to fix

                Method _fb_callback_make_filename_seo_friendly has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _fb_callback_make_filename_seo_friendly(&$filename, $base_path, &$data, $current_image_field_name)
                    {
                        // List of the fields to be used, if no value is present for a given key
                        // then the key will be ignored. By default all values of the keys
                        // specified will be concatenated
                Severity: Minor
                Found in pepiscms/modules/pages/controllers/PagesAdmin.php - About 1 hr to fix

                  Method isAuthenticated has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function isAuthenticated($force_do_all_checks_again = false)
                      {
                          if (!$force_do_all_checks_again) {
                              if ($this->is_authenticated !== null) {
                                  // Kind of cache
                  Severity: Minor
                  Found in pepiscms/application/libraries/Auth.php - About 1 hr to fix

                    Method describeClass has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function describeClass($class, $must_be_declaring = true)
                        {
                            $ignored_methods = array(
                                'ModuleAdminController',
                                'getPrivileges',
                    Severity: Minor
                    Found in pepiscms/application/libraries/SecurityPolicy.php - About 1 hr to fix

                      Method dashboard has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function dashboard()
                          {
                              $user_manual_path = false;
                              if (file_exists('uploads/user-manual.pdf')) {
                                  $user_manual_path = 'uploads/user-manual.pdf';
                      Severity: Minor
                      Found in pepiscms/application/controllers/admin/About.php - About 1 hr to fix

                        Method getFieldDefaults has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getFieldDefaults()
                            {
                                $defaults = array();
                                $defaults['field'] = false; // Field name
                                $defaults['label'] = false; // Field label
                        Severity: Minor
                        Found in pepiscms/application/libraries/FormBuilder.php - About 1 hr to fix

                          Method tailAFile has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function tailAFile($path, $count = 10)
                              {
                                  if (!file_exists($path)) {
                                      return false;
                                  }
                          Severity: Minor
                          Found in pepiscms/modules/symfony2_bridge/models/Symfony2_log_model.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language