phodal/congee

View on GitHub

Showing 421 of 421 total issues

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

      o[ os[i].rows[0] ] = { text: o[ os[i].rows[0] ], row: ns[i].rows[0] };
Severity: Major
Found in ckeditor/plugins/autosave/js/jsdiff.js and 1 other location - About 1 hr to fix
ckeditor/plugins/autosave/js/jsdiff.js on lines 138..138

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

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

CKEDITOR.plugins.setLang( 'templates', 'bs', {
    button: 'Templates', // MISSING
    emptyListMsg: '(No templates defined)', // MISSING
    insertOption: 'Replace actual contents', // MISSING
    options: 'Template Options', // MISSING
Severity: Major
Found in ckeditor/plugins/templates/lang/bs.js and 1 other location - About 1 hr to fix
ckeditor/plugins/templates/lang/mk.js on lines 5..12

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

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

      n[ ns[i].rows[0] ] = { text: n[ ns[i].rows[0] ], row: os[i].rows[0] };
Severity: Major
Found in ckeditor/plugins/autosave/js/jsdiff.js and 1 other location - About 1 hr to fix
ckeditor/plugins/autosave/js/jsdiff.js on lines 139..139

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

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 (m._isValid == null) {
            var flags = getParsingFlags(m);
            m._isValid = !isNaN(m._d.getTime()) &&
                flags.overflow < 0 &&
                !flags.empty &&
Severity: Critical
Found in ckeditor/plugins/autosave/js/moment.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                if ((readable && ! bestIsReadable) ||
                    (readable && bestIsReadable && score > bestScore) ||
                    ((! readable) && (! bestIsReadable) && score > bestScore)) {
                    bestIsReadable = readable;
                    bestScore = score;
    Severity: Critical
    Found in scripts/spectrum/spectrum.js - About 1 hr to fix

      Function nameToUrl has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  nameToUrl: function (moduleName, ext, skipExt) {
                      var paths, syms, i, parentModule, url,
                          parentPath, bundleId,
                          pkgMain = getOwn(config.pkgs, moduleName);
      
      
      Severity: Minor
      Found in scripts/libs/require.js - About 1 hr to fix

        Function diff has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function diff( o, n ) {
          var ns = new Object();
          var os = new Object();
          
          for ( var i = 0; i < n.length; i++ ) {
        Severity: Minor
        Found in ckeditor/plugins/autosave/js/jsdiff.js - About 1 hr to fix

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

                          for (i = 0; i < 3; i += 1) {
                              progId = progIds[i];
                              try {
                                  xhr = new ActiveXObject(progId);
                              } catch (e) {}
          Severity: Major
          Found in scripts/libs/text.js and 1 other location - About 1 hr to fix
          scripts/libs/rv.js on lines 105..115

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

          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

                              for ( var i = 0; i < 3; i += 1 ) {
                                  progId = progIds[ i ];
                                  try {
                                      xhr = new ActiveXObject( progId );
                                  } catch ( e ) {}
          Severity: Major
          Found in scripts/libs/rv.js and 1 other location - About 1 hr to fix
          scripts/libs/text.js on lines 61..71

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

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

                  sort: ( function() {
                      var locations, sorted,
                          dist, i;
          
                      function distance( y, uid, type ) {
          Severity: Minor
          Found in ckeditor/plugins/lineutils/plugin.js - About 1 hr to fix

            Function getXhr has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        var getXhr = function( path ) {
                            // check if same domain
                            var sameDomain = true,
                                domainCheck = /^(\w+:)?\/\/([^\/]+)/.exec( path );
                            if ( typeof window != 'undefined' && domainCheck ) {
            Severity: Minor
            Found in scripts/libs/rv.js - About 1 hr to fix

              Function edit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      edit: function() {
                          var evtData = { dialog: this.dialog },
                              that = this;
              
                          // Edit event was blocked or there's no dialog to be automatically opened.
              Severity: Minor
              Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

                Function popup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    popup: function( url, width, height, options ) {
                        width = width || '80%';
                        height = height || '70%';
                
                        if ( typeof width == 'string' && width.length > 1 && width.substr( width.length - 1, 1 ) == '%' )
                Severity: Minor
                Found in ckeditor/plugins/popup/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 init has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        init: function( editor ) {
                            editor.addCommand( 'selectAll', { modes: { wysiwyg: 1, source: 1 },
                                exec: function( editor ) {
                                    var editable = editor.editable();
                
                
                Severity: Minor
                Found in ckeditor/plugins/selectall/plugin.js - About 1 hr to fix

                  Function popup has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      popup: function( url, width, height, options ) {
                          width = width || '80%';
                          height = height || '70%';
                  
                          if ( typeof width == 'string' && width.length > 1 && width.substr( width.length - 1, 1 ) == '%' )
                  Severity: Minor
                  Found in ckeditor/plugins/popup/plugin.js - About 1 hr to fix

                    Function getSetOffset has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function getSetOffset (input, keepLocalTime) {
                            var offset = this._offset || 0,
                                localAdjust;
                            if (input != null) {
                                if (typeof input === 'string') {
                    Severity: Minor
                    Found in ckeditor/plugins/autosave/js/moment.js - About 1 hr to fix

                      Function configFromStringAndArray has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function configFromStringAndArray(config) {
                              var tempConfig,
                                  bestMoment,
                      
                                  scoreToBeat,
                      Severity: Minor
                      Found in ckeditor/plugins/autosave/js/moment.js - About 1 hr to fix

                        Function setupSelectionObserver has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function setupSelectionObserver( widgetsRepo ) {
                                var editor = widgetsRepo.editor;
                        
                                editor.on( 'selectionCheck', function() {
                                    widgetsRepo.fire( 'checkSelection' );
                        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

                                      tipLeftStyle: CKEDITOR.tools.writeCssText(
                                          CKEDITOR.tools.extend( {}, tipCss, {
                                              left: '0px',
                                              'border-left-color': 'red',
                                              'border-width': '6px 0 6px 6px'
                          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 703..709

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

                          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

                                      tipRightStyle: CKEDITOR.tools.writeCssText(
                                          CKEDITOR.tools.extend( {}, tipCss, {
                                              right: '0px',
                                              'border-right-color': 'red',
                                              'border-width': '6px 6px 6px 0'
                          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 696..702

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

                          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