phodal/congee

View on GitHub

Showing 421 of 421 total issues

Function exec has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            exec: function( editor, commandData ) {
                var focused = editor.widgets.focused;
                // If a widget of the same type is focused, start editing.
                if ( focused && focused.name == widgetDef.name )
                    focused.edit();
Severity: Minor
Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

    Function diffString2 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    function diffString2( o, n ) {
      o = o.replace(/\s+$/, '');
      n = n.replace(/\s+$/, '');
    
      var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/) );
    Severity: Minor
    Found in ckeditor/plugins/autosave/js/jsdiff.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
    Open

        update: function( options ) {
            var show = true;
    
            if ( this.editor.fire( 'notificationUpdate', { notification: this, options: options } ) === false ) {
                // The idea of cancelable event is to let user create his own way of displaying notification, so if
    Severity: Minor
    Found in ckeditor/plugins/notification/plugin.js - About 1 hr 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 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        update: function( options ) {
            var show = true;
    
            if ( this.editor.fire( 'notificationUpdate', { notification: this, options: options } ) === false ) {
                // The idea of cancelable event is to let user create his own way of displaying notification, so if
    Severity: Minor
    Found in ckeditor/plugins/notification/plugin.js - About 1 hr to fix

      Function init has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          init: function( editor ) {
              editor._.notificationArea = new Area( editor );
      
              // Overwrites default `editor.showNotification`.
              editor.showNotification = function( message, type, progressOrDuration ) {
      Severity: Minor
      Found in ckeditor/plugins/notification/plugin.js - About 1 hr to fix

        Function createUpcastIterator has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function createUpcastIterator( widgetsRepo ) {
                var toBeWrapped = [],
                    upcasts = widgetsRepo._.upcasts,
                    upcastCallbacks = widgetsRepo._.upcastCallbacks;
        
        
        Severity: Minor
        Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                      if (config.charCountGreaterThanMaxLengthEvent && config.charCountLessThanMaxLengthEvent) {
                          if (charCount > config.maxCharCount && config.maxCharCount > -1) {
                              config.charCountGreaterThanMaxLengthEvent(charCount, config.maxCharCount);
                          } else {
                              config.charCountLessThanMaxLengthEvent(charCount, config.maxCharCount);
          Severity: Major
          Found in ckeditor/plugins/wordcount/plugin.js and 1 other location - About 1 hr to fix
          ckeditor/plugins/wordcount/plugin.js on lines 292..299

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

          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 (config.wordCountGreaterThanMaxLengthEvent && config.wordCountLessThanMaxLengthEvent) {
                          if (wordCount > config.maxWordCount && config.maxWordCount > -1) {
                              config.wordCountGreaterThanMaxLengthEvent(wordCount, config.maxWordCount);
          
                          } else {
          Severity: Major
          Found in ckeditor/plugins/wordcount/plugin.js and 1 other location - About 1 hr to fix
          ckeditor/plugins/wordcount/plugin.js on lines 284..290

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

          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 setupDragHandler has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function setupDragHandler( widget ) {
                  if ( !widget.draggable )
                      return;
          
                  var editor = widget.editor,
          Severity: Minor
          Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

            Function copyConfig has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function copyConfig(to, from) {
                    var i, prop, val;
            
                    if (typeof from._isAMomentObject !== 'undefined') {
                        to._isAMomentObject = from._isAMomentObject;
            Severity: Minor
            Found in ckeditor/plugins/autosave/js/moment.js - About 1 hr to fix

              Function inputToRGB has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function inputToRGB(color) {
              
                      var rgb = { r: 0, g: 0, b: 0 };
                      var a = 1;
                      var ok = false;
              Severity: Minor
              Found in scripts/spectrum/spectrum.js - About 1 hr to fix

                Function get_grouped_opcodes has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        this.get_grouped_opcodes = function (n) {
                            if (!n) n = 3;
                            var codes = this.get_opcodes();
                            if (!codes) codes = [["equal", 0, 1, 0, 1]];
                            var code, tag, i1, i2, j1, j2;
                Severity: Minor
                Found in ckeditor/plugins/autosave/js/difflib.js - About 1 hr to fix

                  Function init has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      init: function( editor ) {
                          // Register the editing dialog.
                          CKEDITOR.dialog.add( 'simplebox', this.path + 'dialogs/simplebox.js' );
                  
                          // Register the simplebox widget.
                  Severity: Minor
                  Found in ckeditor/plugins/widget/dev/assets/simplebox/plugin.js - About 1 hr 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 diffString has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function diffString( o, n ) {
                    o = o.replace(/\s+$/, '');
                    n = n.replace(/\s+$/, '');
                  
                    var out = diff(o == "" ? [] : o.split(/\s+/), n == "" ? [] : n.split(/\s+/) );
                  Severity: Minor
                  Found in ckeditor/plugins/autosave/js/jsdiff.js - About 1 hr to fix

                    Function load has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        req.load = function (context, moduleName, url) {
                            var config = (context && context.config) || {},
                                node;
                            if (isBrowser) {
                                //In the browser so use a script tag
                    Severity: Minor
                    Found in scripts/libs/require.js - About 1 hr to fix

                      Function load has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                      load: function( name, req, load, config ) {
                                          var path = req.toUrl( name );
                                          var queryString = '';
                                          if ( path.indexOf( '?' ) != -1 ) {
                                              queryString = path.substr( path.indexOf( '?' ) );
                      Severity: Minor
                      Found in scripts/libs/rv.js - About 1 hr to fix

                        Function __chain_b has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                this.__chain_b = function () {
                                    var b = this.b;
                                    var n = b.length;
                                    var b2j = this.b2j = {};
                                    var populardict = {};
                        Severity: Minor
                        Found in ckeditor/plugins/autosave/js/difflib.js - About 1 hr to fix

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

                              case 'loose_item_start': {
                                var body = '';
                          
                                while (this.next().type !== 'list_item_end') {
                                  body += this.tok();
                          Severity: Major
                          Found in ckeditor/plugins/markdown/js/marked.js and 1 other location - About 1 hr to fix
                          ckeditor/plugins/markdown/js/marked.js on lines 1018..1026

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

                          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

                              case 'blockquote_start': {
                                var body = '';
                          
                                while (this.next().type !== 'blockquote_end') {
                                  body += this.tok();
                          Severity: Major
                          Found in ckeditor/plugins/markdown/js/marked.js and 1 other location - About 1 hr to fix
                          ckeditor/plugins/markdown/js/marked.js on lines 1048..1056

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

                          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

                                  hideLine: function( line ) {
                                      var uid = line.getUniqueId();
                          
                                      line.hide();
                          
                          
                          Severity: Major
                          Found in ckeditor/plugins/lineutils/plugin.js and 1 other location - About 1 hr to fix
                          ckeditor/plugins/lineutils/plugin.js on lines 750..757

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

                          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