krafthaus/bauhaus

View on GitHub

Showing 1,049 of 1,049 total issues

Avoid deeply nested control flow statements.
Open

                            if (colSpan) {
                                if (x + colSpan > maxX) {
                                    maxX = x + colSpan;
                                }
                            }
Severity: Major
Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if (listElements[y] === node) {
                                    listElements.splice(i, 1);
                                    break;
                                }
    Severity: Major
    Found in bower_components/tinymce/plugins/lists/plugin.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  for (c = 1; c <= cols; c++) {
                                      dom.insertAfter(cloneCell(cell), cell);
                                  }
      Severity: Major
      Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    for (var i = 0; i < groups.length; i++) {
                                        if (!groups[i].filter || groups[i].filter(selector)) {
                                            if (!groups[i].item) {
                                                groups[i].item = {text: groups[i].title, menu: []};
                                            }
        Severity: Major
        Found in bower_components/tinymce/plugins/importcss/plugin.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          if (editor.settings.video_template_callback) {
                              html = editor.settings.video_template_callback(data);
                          } else {
                              html = (
                                  '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' +
          Severity: Major
          Found in bower_components/tinymce/plugins/media/plugin.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (value) {
                                            attrs.map[name] = value;
                                            attr.value = value;
                                        } else {
                                            delete attrs.map[name];
            Severity: Major
            Found in bower_components/tinymce/plugins/media/plugin.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (rowSpan > 1) {
                                              setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
                                              continue;
                                          }
              Severity: Major
              Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (children.length) {
                                                children = Tools.grep(startCell.childNodes);
                                                count = 0;
                                                each(children, function(node) {
                                                    if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) {
                Severity: Major
                Found in bower_components/tinymce/plugins/table/plugin.js - About 45 mins to fix

                  Function arrayToXml has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function arrayToXml($result, &$xml)
                      {
                          foreach ($result as $key => $value) {
                              if (is_array($value)) {
                                  if (!is_numeric($key)) {
                  Severity: Minor
                  Found in src/KraftHaus/Bauhaus/Export/Format/XmlFormat.php - About 45 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 postUpdate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function postUpdate($input)
                      {
                          foreach ($this->getSizes() as $size) {
                              $name = $this->getName();
                  
                  
                  Severity: Minor
                  Found in src/KraftHaus/Bauhaus/Field/ImageField.php - About 45 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 render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function render()
                      {
                          if ($this->getDisplayField() === null) {
                              throw new \InvalidArgumentException(sprintf('Please provide a display field for the `%s` relation.', $this->getName()));
                          }
                  Severity: Minor
                  Found in src/KraftHaus/Bauhaus/Field/BelongsToManyField.php - About 45 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

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

                      editor.on('keyup', function(e) {
                          if (e.keyCode == 32 && !tinymce.util.VK.modifierPressed(e)) {
                              handleSpace();
                          }
                      });
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/textpattern/plugin.js and 1 other location - About 45 mins to fix
                  bower_components/tinymce/plugins/textpattern/plugin.js on lines 251..255

                  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 50.

                  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

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

                          onPostRender: function() {
                              var self = this;
                  
                              editor.on('FullscreenStateChanged', function(e) {
                                  self.active(e.state);
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/fullscreen/plugin.js and 1 other location - About 45 mins to fix
                  bower_components/tinymce/plugins/fullscreen/plugin.js on lines 108..114

                  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 50.

                  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

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

                              if (fi > -1) {
                                  nl[ci].style.zIndex = z[fi];
                                  nl[fi].style.zIndex = z[ci];
                              } else {
                                  if (z[ci] > 0) {
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/layer/plugin.js and 1 other location - About 45 mins to fix
                  bower_components/tinymce/plugins/layer/plugin.js on lines 87..92

                  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 50.

                  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

                                  if (!le.style.height) {
                                      le.style.height = le.height ? (le.height + 'px') : '100px';
                                  }
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/layer/plugin.js and 1 other location - About 45 mins to fix
                  bower_components/tinymce/plugins/layer/plugin.js on lines 147..149

                  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 50.

                  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

                      editor.on('keydown', function(e) {
                          if (e.keyCode == 13 && !tinymce.util.VK.modifierPressed(e)) {
                              handleEnter();
                          }
                      }, true);
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/textpattern/plugin.js and 1 other location - About 45 mins to fix
                  bower_components/tinymce/plugins/textpattern/plugin.js on lines 257..261

                  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 50.

                  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

                                      if ((year == endYear && month >= endMonth) || year > endYear) {
                                          picker.widget.find('.datepicker-days th:eq(2)').addClass('disabled');
                                      }
                  bower_components/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js on lines 378..380

                  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 50.

                  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

                                  if (!le.style.width) {
                                      le.style.width = le.width ? (le.width + 'px') : '100px';
                                  }
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/layer/plugin.js and 1 other location - About 45 mins to fix
                  bower_components/tinymce/plugins/layer/plugin.js on lines 151..153

                  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 50.

                  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

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

                          onPostRender: function() {
                              var self = this;
                  
                              editor.on('FullscreenStateChanged', function(e) {
                                  self.active(e.state);
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/fullscreen/plugin.js and 1 other location - About 45 mins to fix
                  bower_components/tinymce/plugins/fullscreen/plugin.js on lines 122..128

                  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 50.

                  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

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

                              if (fi > -1) {
                                  nl[ci].style.zIndex = z[fi];
                                  nl[fi].style.zIndex = z[ci];
                              } else {
                                  nl[ci].style.zIndex = z[ci] + 1;
                  Severity: Minor
                  Found in bower_components/tinymce/plugins/layer/plugin.js and 1 other location - About 45 mins to fix
                  bower_components/tinymce/plugins/layer/plugin.js on lines 68..75

                  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 50.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language