mambax7/references

View on GitHub

Showing 290 of 2,627 total issues

File references_articles.php has 376 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * ****************************************************************************
 * references - MODULE FOR XOOPS
 * Copyright (c) Hervé Thouzard of Instant Zero (http://www.instant-zero.com)
Severity: Minor
Found in class/references_articles.php - About 5 hrs to fix

    references_listFilter has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class references_listFilter
    {
        const FILTER_DATA_TEXT    = 1;
        const FILTER_DATA_NUMERIC = 2;
    
    
    Severity: Minor
    Found in class/references_listFilter.php - About 5 hrs to fix

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

          initialize: function (event, win) {
              win = win || window;
              var doc = win.document;
              event = event || win.event;
              if (event.$extended) return event;
      Severity: Minor
      Found in assets/js/js/mootools.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 doCall has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          private function doCall($url, array $parameters = null, $authenticate = false, $method = 'GET', $filePath = null, $expectJSON = true)
          {
              // allowed methods
              $allowedMethods = array('GET', 'POST');
      
      
      Severity: Minor
      Found in plugins/actions/twitter/twitter.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 save has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

          public function save($data, $id = null, $group = 'default')
          {
              if ($this->_caching) {
                  if ($this->_automaticSerialization) {
                      $data = serialize($data);
      Severity: Minor
      Found in class/lite.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 find has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              find: function (t, context) {
                  // Quickly handle non-string expressions
                  if (typeof t != "string")
                      return [t];
      
      
      Severity: Major
      Found in assets/js/autocomplete/lib/jquery.js - About 4 hrs to fix

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

            public function get($id, $group = 'default', $doNotTestCacheValidity = false)
            {
                $this->_id    = $id;
                $this->_group = $group;
                $data         = false;
        Severity: Minor
        Found in class/lite.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

        Consider simplifying this complex logical expression.
        Open

                        if (typeof elem == "string") {
                            // Fix "XHTML"-style tags in all browsers
                            elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function (all, front, tag) {
                                return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
                                    all :
        Severity: Critical
        Found in assets/js/autocomplete/lib/jquery.js - About 4 hrs to fix

          Function getStyle has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              getStyle: function (property) {
                  switch (property) {
                      case 'opacity':
                          return this.get('opacity');
                      case 'float':
          Severity: Minor
          Found in assets/js/js/mootools.js - About 3 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 Cache has 94 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.Autocompleter.Cache = function (options) {
          
                  var data = {};
                  var length = 0;
          
          
          Severity: Major
          Found in assets/js/autocomplete/jquery.autocomplete.js - About 3 hrs to fix

            Function __construct has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null)
                {
                    if ($mode === null) {
                        $mode = references_PEAR_ERROR_RETURN;
                    }
            Severity: Minor
            Found in class/PEAR.php - About 3 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 doCall has 90 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function doCall($url, array $parameters = null, $authenticate = false, $method = 'GET', $filePath = null, $expectJSON = true)
                {
                    // allowed methods
                    $allowedMethods = array('GET', 'POST');
            
            
            Severity: Major
            Found in plugins/actions/twitter/twitter.php - About 3 hrs to fix

              Function convertResultSet has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function convertResultSet($result, $id_as_key = false, $as_object = true, $fields = '*')
                  {
                      $ret = array();
                      while ($myrow = $this->db->fetchArray($result)) {
                          $obj =& $this->create(false);
              Severity: Minor
              Found in class/PersistableObjectHandler.php - About 3 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

              Consider simplifying this complex logical expression.
              Open

                                      if ((type == "" && !!z ||
                                          type == "=" && z == m[5] ||
                                          type == "!=" && z != m[5] ||
                                          type == "^=" && z && !z.indexOf(m[5]) ||
                                          type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
              Severity: Critical
              Found in assets/js/autocomplete/lib/jquery.js - About 3 hrs to fix

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

                    public function insert(XoopsObject $obj, $force = false, $checkObject = true, $ignoreInsert = false)
                    {
                        if ($checkObject != false) {
                            if (!is_object($obj)) {
                                trigger_error('Error, not object');
                Severity: Major
                Found in class/PersistableObjectHandler.php - About 3 hrs to fix

                  Function createThumb has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function createThumb($src_path, $dst_path, $param_width, $param_height, $keep_original = false, $fit = 'inside')
                      {
                          //        require_once self::MODULE_PATH . 'class/wideimage/WideImage.php';
                          $resize = true;
                          // On commence par vérifier que l'image originale n'est pas plus petite que les dimensions demandées auquel cas il n'y a rien à faire
                  Severity: Minor
                  Found in class/references_utils.php - About 3 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 Native has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var Native = function (options) {
                      options = options || {};
                      var name = options.name;
                      var legacy = options.legacy;
                      var protect = options.protect;
                  Severity: Minor
                  Found in assets/js/js/mootools.js - About 3 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 uploadFile has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function uploadFile($indice, $dstpath = XOOPS_UPLOAD_PATH, $mimeTypes = null, $uploadMaxSize = null, $maxWidth = null, $maxHeight = null)
                      {
                          require_once XOOPS_ROOT_PATH . '/class/uploader.php';
                          global $destname;
                          if (isset($_POST['xoops_upload_file'])) {
                  Severity: Minor
                  Found in class/references_utils.php - About 3 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 toArray has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function toArray($format = 's')
                      {
                          $ret                       = array();
                          $ret                       = parent::toArray($format);
                          $hrefTitle                 = $this->getHrefTitle();
                  Severity: Minor
                  Found in class/references_articles.php - About 2 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 filter has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          filter: function (t, r, not) {
                              var last;
                  
                              // Look for common filter expressions
                              while (t && t != last) {
                  Severity: Major
                  Found in assets/js/autocomplete/lib/jquery.js - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language