Showing 13 of 25 total issues

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

    function init()
    {
        $this->_a['table'] = 'cms_contents';
        $this->_a['cols'] = array(
            // Identifier
Severity: Major
Found in src/CMS/Content.php - About 6 hrs to fix

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

        function init()
        {
            $this->_a['table'] = 'cms_content_histories';
            $this->_a['verbose'] = 'CMS Content History';
            $this->_a['cols'] = array(
    Severity: Major
    Found in src/CMS/ContentHistory.php - About 3 hrs to fix

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

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

        File content.php has 268 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*
         * This file is part of Pluf Framework, a simple PHP Application Framework.
         * Copyright (C) 2010-2020 Phoinex Scholars Co. (http://dpq.co.ir)
         *
        Severity: Minor
        Found in src6/urls/content.php - About 2 hrs to fix

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

              public static function find($request, $match)
              {
                  if (isset($match['name'])) {
                      $content = CMS_Shortcuts_GetNamedContentOr404($match['name']);
                  } else {
          Severity: Minor
          Found in src/CMS/Views/ContentHistory.php - About 1 hr to fix

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

                function init()
                {
                    $this->_a['table'] = 'cms_term_metas';
                    $this->_a['cols'] = array(
                        // Identifier
            Severity: Minor
            Found in src/CMS/TermMeta.php - About 1 hr to fix

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

                  function init()
                  {
                      $this->_a['table'] = 'cms_content_metas';
                      $this->_a['cols'] = array(
                          // Identifier
              Severity: Minor
              Found in src/CMS/ContentMeta.php - About 1 hr to fix

                Function save has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    function save($commit = true)
                    {
                        $model = parent::save(false);
                        // update the content
                        if (array_key_exists('file', $this->cleaned_data)) {
                Severity: Minor
                Found in src/CMS/Form/ContentUpdate.php - About 45 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 addContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function addContent($request, $match)
                    {
                        $tt = Pluf_Shortcuts_GetObjectOr404('CMS_TermTaxonomy', $match['parentId']);
                        $content = NULL;
                        if (array_key_exists('modelId', $match)) {
                Severity: Minor
                Found in src/CMS/Views/TermTaxonomy.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 removeContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function removeContent($request, $match)
                    {
                        $tt = Pluf_Shortcuts_GetObjectOr404('CMS_TermTaxonomy', $match['parentId']);
                        $content = NULL;
                        if (array_key_exists('modelId', $match)) {
                Severity: Minor
                Found in src/CMS/Views/TermTaxonomy.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 addTermTaxonomy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function addTermTaxonomy($request, $match)
                    {
                        $content = Pluf_Shortcuts_GetObjectOr404('CMS_Content', $match['parentId']);
                        $tt = NULL;
                        if (array_key_exists('modelId', $match)) {
                Severity: Minor
                Found in src/CMS/Views.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 removeTermTaxonomy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function removeTermTaxonomy($request, $match)
                    {
                        $content = Pluf_Shortcuts_GetObjectOr404('CMS_Content', $match['parentId']);
                        $tt = NULL;
                        if (array_key_exists('modelId', $match)) {
                Severity: Minor
                Found in src/CMS/Views.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 preSave has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    function preSave($create = false)
                    {
                        if($this->_internal){
                            // this function do nothing in the internal state.
                            return;
                Severity: Minor
                Found in src/CMS/Content.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

                Severity
                Category
                Status
                Source
                Language