moebooru/moebooru

View on GitHub

Showing 370 of 8,198 total issues

Avoid too many return statements within this function.
Open

    return 0;
Severity: Major
Found in lib/assets/javascripts/prototype/prototype.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                            return diff == 0;
    Severity: Major
    Found in lib/assets/javascripts/prototype/prototype.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return element;
      Severity: Major
      Found in lib/assets/javascripts/prototype/prototype.js - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return [:gt, parse_cast(Regexp.last_match[1], type)]
        Severity: Major
        Found in app/models/tag/parse_methods.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return [:eq, parse_cast(range, type)]
          Severity: Major
          Found in app/models/tag/parse_methods.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return true
            Severity: Major
            Found in app/models/post/file_methods.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return false
              Severity: Major
              Found in app/models/inline_image.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                      return true
                Severity: Major
                Found in app/models/post/file_methods.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                        return false
                  Severity: Major
                  Found in app/models/post/file_methods.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return true
                    Severity: Major
                    Found in app/models/post/file_methods.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return [:in, items]
                      Severity: Major
                      Found in app/models/tag/parse_methods.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                              return false
                        Severity: Major
                        Found in app/models/post/file_methods.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                              return if pending_posts < CONFIG["max_pending_images"]
                          Severity: Major
                          Found in app/models/post/file_methods.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                      return
                            Severity: Major
                            Found in app/controllers/post_controller.rb - About 30 mins to fix

                              Function next has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                next: function(element, expression, index) {
                                  element = $(element);
                                  if (Object.isNumber(expression)) index = expression, expression = false;
                                  if (!Object.isNumber(index)) index = 0;
                              
                              
                              Severity: Minor
                              Found in lib/assets/javascripts/prototype/prototype.js - 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

                              Function createForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                createForm: function() {
                                  var ipe = this;
                                  function addText(mode, condition) {
                                    var text = ipe.options['text' + mode + 'Controls'];
                                    if (!text || condition === false) return;
                              Severity: Minor
                              Found in lib/assets/javascripts/prototype/controls.js - 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

                              Function collectTextNodesIgnoreClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Element.collectTextNodesIgnoreClass = function(element, className) {
                                return $A($(element).childNodes).collect( function(node) {
                                  return (node.nodeType==3 ? node.nodeValue :
                                    ((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
                                      Element.collectTextNodesIgnoreClass(node, className) : ''));
                              Severity: Minor
                              Found in lib/assets/javascripts/prototype/effects.js - 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

                              Function update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                update: function(position) {
                                  var style = { }, transform, i = this.transforms.length;
                                  while(i--)
                                    style[(transform = this.transforms[i]).style] =
                                      transform.unit=='color' ? '#'+
                              Severity: Minor
                              Found in lib/assets/javascripts/prototype/effects.js - 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

                              Function getStorage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                getStorage: function(element) {
                                  if (!(element = $(element))) return;
                              
                                  var uid;
                                  if (element === window) {
                              Severity: Minor
                              Found in lib/assets/javascripts/prototype/prototype.js - 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

                              Function _getContentFromAnonymousElement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Element._getContentFromAnonymousElement = function(tagName, html, force) {
                                var div = new Element('div'),
                                    t = Element._insertionTranslations.tags[tagName];
                              
                                var workaround = false;
                              Severity: Minor
                              Found in lib/assets/javascripts/prototype/prototype.js - 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