mambax7/smartobject

View on GitHub

Showing 646 of 1,188 total issues

Function getVar has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
Open

    public function getVar($key, $format = 's')
    {
        global $myts;

        $ret = $this->vars[$key]['value'];
Severity: Minor
Found in class/BaseSmartObject.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 unittest.js has 556 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// script.aculo.us unittest.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006

// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//           (c) 2005 Jon Tirsen (http://www.tirsen.com)
//           (c) 2005 Michael Schuerig (http://www.schuerig.de/michael/)
Severity: Major
Found in include/scriptaculous/src/unittest.js - About 1 day to fix

    File Table.php has 542 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php namespace XoopsModules\Smartobject;
    
    /**
     * Contains the classes responsible for displaying a simple table filled with records of SmartObjects
     *
    Severity: Major
    Found in class/Table.php - About 1 day to fix

      Function xoops_module_update_smartobject has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
      Open

      function xoops_module_update_smartobject(\XoopsModule $module)
      {
          ob_start();
      
          $dbVersion = Smartobject\Utility::getMeta('version', 'smartobject');
      Severity: Minor
      Found in include/update.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 getVar has 221 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getVar($key, $format = 's')
          {
              global $myts;
      
              $ret = $this->vars[$key]['value'];
      Severity: Major
      Found in class/BaseSmartObject.php - About 1 day to fix

        Utility has 58 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Utility
        {
            use Common\VersionChecks; //checkVerXoops, checkVerPhp Traits
        
            use Common\ServerStats; // getServerStats Trait
        Severity: Major
        Found in class/Utility.php - About 1 day to fix

          Function createTableRows has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
          Open

              public function createTableRows()
              {
                  $this->_aObjects = [];
          
                  $doWeHaveActions = false;
          Severity: Minor
          Found in class/Table.php - About 7 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

          Function render has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render($fetchOnly = false, $debug = false)
              {
                  require_once XOOPS_ROOT_PATH . '/class/template.php';
          
                  $this->_tpl = new \XoopsTpl();
          Severity: Minor
          Found in class/Table.php - About 7 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

          BaseSmartObject has 54 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class BaseSmartObject extends \XoopsObject
          {
              public $_image_path;
              public $_image_url;
          
          
          Severity: Major
          Found in class/BaseSmartObject.php - About 7 hrs to fix

            Method xoops_module_update_smartobject has 185 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function xoops_module_update_smartobject(\XoopsModule $module)
            {
                ob_start();
            
                $dbVersion = Smartobject\Utility::getMeta('version', 'smartobject');
            Severity: Major
            Found in include/update.php - About 7 hrs to fix

              Function upgradeObjectItem has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function upgradeObjectItem($module, $item)
                  {
                      $moduleHandler = xoops_getModuleHandler($item, $module);
                      if (!$moduleHandler) {
                          return false;
              Severity: Minor
              Found in class/Dbupdater.php - About 6 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

              Method update_tables_to_300 has 166 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function update_tables_to_300()
              {
                  $dbupdater = new Wfdownloads\Dbupdater();
              
                  if (!wfdownloads_TableExists('wfdownloads_meta')) {
              Severity: Major
              Found in admin/update.php - About 6 hrs to fix

                Method render has 166 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function render($fetchOnly = false, $debug = false)
                    {
                        require_once XOOPS_ROOT_PATH . '/class/template.php';
                
                        $this->_tpl = new \XoopsTpl();
                Severity: Major
                Found in class/Table.php - About 6 hrs to fix

                  Function node has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                  Open

                  dTree.prototype.node = function (node, nodeId) {
                  
                      var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
                  
                      if (this.config.useIcons) {
                  Severity: Minor
                  Found in include/dtree.js - About 6 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

                  Function node has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      node: function (elementName) {
                          elementName = elementName.toUpperCase();
                  
                          // try innerHTML approach
                          var parentTag = this.NODEMAP[elementName] || 'div';
                  Severity: Minor
                  Found in include/projax_/js/builder.js - 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

                  Function indent has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                  dTree.prototype.indent = function (node, nodeId) {
                  
                      var str = '';
                  
                      if (this.root.id != node.pid) {
                  Severity: Minor
                  Found in include/dtree.js - 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

                  Function node has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      node: function (elementName) {
                          elementName = elementName.toUpperCase();
                  
                          // try innerHTML approach
                          var parentTag = this.NODEMAP[elementName] || 'div';
                  Severity: Minor
                  Found in include/projax/js/builder.js - 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

                  Function node has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      node: function (elementName) {
                          elementName = elementName.toUpperCase();
                  
                          // try innerHTML approach
                          var parentTag = this.NODEMAP[elementName] || 'div';
                  Severity: Minor
                  Found in include/scriptaculous/src/builder.js - 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

                  Function postDataToObject has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function postDataToObject(&$smartObj)
                      {
                          foreach (array_keys($smartObj->vars) as $key) {
                              switch ($smartObj->vars[$key]['data_type']) {
                                  case XOBJ_DTYPE_IMAGE:
                  Severity: Minor
                  Found in class/ObjectController.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

                  Methods has 43 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  Element.Methods = {
                      visible: function (element) {
                          return $(element).style.display != 'none';
                      },
                  
                  
                  Severity: Minor
                  Found in include/projax_/js/prototype.js - About 5 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language