mambax7/smartobject

View on GitHub

Showing 646 of 1,188 total issues

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

    Function doStoreFromDefaultForm has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        public function doStoreFromDefaultForm(
            &$smartObj,
            $objectid,
            $created_success_msg,
            $modified_success_msg,
    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

    Table has 40 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Table
    {
        public $_id;
        public $_objectHandler;
        public $_columns;
    Severity: Minor
    Found in class/Table.php - About 5 hrs to fix

      Method insert has 131 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function insert(\XoopsObject $obj, $force = false, $checkObject = true, $debug = false)
          {
              if (false !== $checkObject) {
                  if (!is_object($obj)) {
                      return false;
      Severity: Major
      Found in class/PersistableObjectHandler.php - About 5 hrs to fix

        Methods has 39 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_b.js - About 5 hrs to fix

          Methods has 39 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_b.js - About 5 hrs to fix

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

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

              Function setStyle has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  setStyle: function (element, style) {
                      element = $(element);
                      for (var name in style) {
                          var value = style[name];
                          if (name == 'opacity') {
              Severity: Minor
              Found in include/projax_/js/prototype.js - About 4 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 setStyle has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  setStyle: function (element, style) {
                      element = $(element);
                      for (var name in style) {
                          var value = style[name];
                          if (name == 'opacity') {
              Severity: Minor
              Found in include/projax/js/prototype.js - About 4 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 addto has 120 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function addto(addsite) {
                  switch (addsite) {
                      case 0: //  AddToBookmarks.com ID:0 - an educational page on what Social Bookmarking is
                          var AddSite = "http://www.addtobookmarks.com/socialbookmarking.htm?";
                          var AddUrlVar = "url";
              Severity: Major
              Found in include/addto/addto.js - About 4 hrs to fix

                Function createElements has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function createElements()
                    {
                        $controls = $this->targetObject->controls;
                        $vars     = $this->targetObject->vars;
                        foreach ($vars as $key => $var) {
                Severity: Minor
                Found in class/Form/SmartObjectForm.php - About 4 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 addAndActivateUser has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function addAndActivateUser($userObj, $groups = false, $notifyUser = true, &$password = false)
                    {
                        $email = $userObj->getVar('email');
                        if (!$userObj->getVar('email') || '' === $email) {
                            $userObj->setErrors(_CO_SOBJECT_USER_NEED_EMAIL);
                Severity: Minor
                Found in class/MemberHandler.php - About 4 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 cleanVars has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function cleanVars()
                    {
                        $ts              = \MyTextSanitizer::getInstance();
                        $existing_errors = $this->getErrors();
                        $this->_errors   = [];
                Severity: Major
                Found in class/BaseSmartObject.php - About 4 hrs to fix

                  File ObjectController.php has 338 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php namespace XoopsModules\Smartobject;
                  
                  /**
                   * Contains the basis classes for managing any objects derived from SmartObjects
                   *
                  Severity: Minor
                  Found in class/ObjectController.php - About 4 hrs to fix

                    Function setOptions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        setOptions: function (options) {
                            this.options = Object.extend({
                                choices: 10,
                                partialSearch: true,
                                partialChars: 2,
                    Severity: Minor
                    Found in include/projax_/js/controls.js - About 4 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 setOptions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        setOptions: function (options) {
                            this.options = Object.extend({
                                choices: 10,
                                partialSearch: true,
                                partialChars: 2,
                    Severity: Minor
                    Found in include/projax/js/controls.js - About 4 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 __construct has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function __construct($object, $key)
                        {
                            $var = $object->vars[$key];
                    
                            parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'));
                    Severity: Minor
                    Found in class/Form/Elements/SmartFormRadioElement.php - About 4 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 getTextArea has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getTextArea($key)
                        {
                            $var = $this->targetObject->vars[$key];
                    
                            // if no control has been created, let's create a default one
                    Severity: Minor
                    Found in class/Form/SmartObjectForm.php - About 4 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 __construct has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function __construct($object, $key)
                        {
                            $var  = $object->vars[$key];
                            $size = isset($var['size']) ? $var['size'] : ($this->multiple ? 5 : 1);
                    
                    
                    Severity: Minor
                    Found in class/Form/Elements/SmartFormSelectElement.php - About 4 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 setOptions has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                    Open

                        setOptions: function (options) {
                            this.options = Object.extend({
                                choices: 10,
                                partialSearch: true,
                                partialChars: 2,
                    Severity: Minor
                    Found in include/scriptaculous/src/controls.js - About 4 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

                    Severity
                    Category
                    Status
                    Source
                    Language