mambax7/references

View on GitHub

Showing 2,627 of 2,627 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public function friendsIds($id = null, $userId = null, $screenName = null, $cursor = null)
    {
        // validate
        if ($id == '' && $userId == '' && $screenName == '') throw new TwitterException('Specify an id or an userId or a screenName.');

Severity: Major
Found in plugins/actions/twitter/twitter.php and 1 other location - About 5 hrs to fix
plugins/actions/twitter/twitter.php on lines 1883..1896

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 189.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            public function reportSpam($id = null, $userId = null, $screenName = null)
            {
                // validate
                if ($id == '' && $userId == '' && $screenName == '') throw new TwitterException('Specify an id or an userId or a screenName.');
        
        
        Severity: Major
        Found in plugins/actions/twitter/twitter.php and 5 other locations - About 4 hrs to fix
        plugins/actions/twitter/twitter.php on lines 1744..1756
        plugins/actions/twitter/twitter.php on lines 2113..2125
        plugins/actions/twitter/twitter.php on lines 2140..2152
        plugins/actions/twitter/twitter.php on lines 2169..2181
        plugins/actions/twitter/twitter.php on lines 2196..2208

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 164.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            public function blocksDestroy($id = null, $userId = null, $screenName = null)
            {
                // validate
                if ($id == '' && $userId == '' && $screenName == '') throw new TwitterException('Specify an id or an userId or a screenName.');
        
        
        Severity: Major
        Found in plugins/actions/twitter/twitter.php and 5 other locations - About 4 hrs to fix
        plugins/actions/twitter/twitter.php on lines 1744..1756
        plugins/actions/twitter/twitter.php on lines 2113..2125
        plugins/actions/twitter/twitter.php on lines 2140..2152
        plugins/actions/twitter/twitter.php on lines 2169..2181
        plugins/actions/twitter/twitter.php on lines 2286..2298

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 164.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            public function friendshipsDestroy($id = null, $userId = null, $screenName = null)
            {
                // validate
                if ($id == '' && $userId == '' && $screenName == '') throw new TwitterException('Specify an id or an userId or a screenName.');
        
        
        Severity: Major
        Found in plugins/actions/twitter/twitter.php and 5 other locations - About 4 hrs to fix
        plugins/actions/twitter/twitter.php on lines 2113..2125
        plugins/actions/twitter/twitter.php on lines 2140..2152
        plugins/actions/twitter/twitter.php on lines 2169..2181
        plugins/actions/twitter/twitter.php on lines 2196..2208
        plugins/actions/twitter/twitter.php on lines 2286..2298

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 164.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            public function notificationsLeave($id = null, $userId = null, $screenName = null)
            {
                // validate
                if ($id == '' && $userId == '' && $screenName == '') throw new TwitterException('Specify an id or an userId or a screenName.');
        
        
        Severity: Major
        Found in plugins/actions/twitter/twitter.php and 5 other locations - About 4 hrs to fix
        plugins/actions/twitter/twitter.php on lines 1744..1756
        plugins/actions/twitter/twitter.php on lines 2113..2125
        plugins/actions/twitter/twitter.php on lines 2169..2181
        plugins/actions/twitter/twitter.php on lines 2196..2208
        plugins/actions/twitter/twitter.php on lines 2286..2298

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 164.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            public function notificationsFollow($id = null, $userId = null, $screenName = null)
            {
                // validate
                if ($id == '' && $userId == '' && $screenName == '') throw new TwitterException('Specify an id or an userId or a screenName.');
        
        
        Severity: Major
        Found in plugins/actions/twitter/twitter.php and 5 other locations - About 4 hrs to fix
        plugins/actions/twitter/twitter.php on lines 1744..1756
        plugins/actions/twitter/twitter.php on lines 2140..2152
        plugins/actions/twitter/twitter.php on lines 2169..2181
        plugins/actions/twitter/twitter.php on lines 2196..2208
        plugins/actions/twitter/twitter.php on lines 2286..2298

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 164.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

            public function blocksCreate($id = null, $userId = null, $screenName = null)
            {
                // validate
                if ($id == '' && $userId == '' && $screenName == '') throw new TwitterException('Specify an id or an userId or a screenName.');
        
        
        Severity: Major
        Found in plugins/actions/twitter/twitter.php and 5 other locations - About 4 hrs to fix
        plugins/actions/twitter/twitter.php on lines 1744..1756
        plugins/actions/twitter/twitter.php on lines 2113..2125
        plugins/actions/twitter/twitter.php on lines 2140..2152
        plugins/actions/twitter/twitter.php on lines 2196..2208
        plugins/actions/twitter/twitter.php on lines 2286..2298

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 164.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public function statusesFollowers($id = null, $userId = null, $screenName = null, $cursor = null)
              {
                  // build parameters
                  $parameters = array();
                  if ($id != null) $parameters['id'] = (string)$id;
          Severity: Major
          Found in plugins/actions/twitter/twitter.php and 1 other location - About 4 hrs to fix
          plugins/actions/twitter/twitter.php on lines 1178..1189

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 162.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public function statusesFriends($id = null, $userId = null, $screenName = null, $cursor = null)
              {
                  // build parameters
                  $parameters = array();
                  if ($id != null) $parameters['id'] = (string)$id;
          Severity: Major
          Found in plugins/actions/twitter/twitter.php and 1 other location - About 4 hrs to fix
          plugins/actions/twitter/twitter.php on lines 1201..1212

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 162.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

            Severity
            Category
            Status
            Source
            Language