phodal/congee

View on GitHub

Showing 200 of 421 total issues

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

    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

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

                        Function iso_string__toISOString has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function iso_string__toISOString() {
                                // for ISO strings we do not use the normal bubbling rules:
                                //  * milliseconds bubble up until they become hours
                                //  * days do not bubble at all
                                //  * months bubble up until they become years
                        Severity: Minor
                        Found in ckeditor/plugins/autosave/js/moment.js - About 1 hr to fix

                          Function Widget has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function Widget( widgetsRepo, id, element, widgetDef, startupData ) {
                                  var editor = widgetsRepo.editor;
                          
                                  // Extend this widget with widgetDef-specific methods and properties.
                                  CKEDITOR.tools.extend( this, widgetDef, {
                          Severity: Minor
                          Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

                            Function bubble has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function bubble () {
                                    var milliseconds = this._milliseconds;
                                    var days         = this._days;
                                    var months       = this._months;
                                    var data         = this._data;
                            Severity: Minor
                            Found in ckeditor/plugins/autosave/js/moment.js - About 1 hr to fix

                              Function startOf has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function startOf (units) {
                                      units = normalizeUnits(units);
                                      // the following switch intentionally omits break keywords
                                      // to utilize falling through the cases.
                                      switch (units) {
                              Severity: Minor
                              Found in ckeditor/plugins/autosave/js/moment.js - About 1 hr to fix

                                Function fromText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                                    load.fromText = bind(this, function (text, textAlt) {
                                                        /*jslint evil: true */
                                                        var moduleName = map.name,
                                                            moduleMap = makeModuleMap(moduleName),
                                                            hasInteractive = useInteractive;
                                Severity: Minor
                                Found in scripts/libs/require.js - About 1 hr to fix

                                  Function checkWidgets has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function checkWidgets( evt ) {
                                          var options = evt.data;
                                  
                                          if ( this.editor.mode != 'wysiwyg' )
                                              return;
                                  Severity: Minor
                                  Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

                                    Function parseName has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            parseName: function (name) {
                                                var modName, ext, temp,
                                                    strip = false,
                                                    index = name.indexOf("."),
                                                    isRelative = name.indexOf('./') === 0 ||
                                    Severity: Minor
                                    Found in scripts/libs/text.js - About 1 hr to fix

                                      Function _createElement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          _createElement: function() {
                                              var notification = this,
                                                  notificationElement, notificationMessageElement, notificationCloseElement,
                                                  close = this.editor.lang.common.close;
                                      
                                      
                                      Severity: Minor
                                      Found in ckeditor/plugins/notification/plugin.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language