Semantic-Org/Semantic-UI

View on GitHub

Showing 246 of 804 total issues

Function standard has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    standard: function(response, fields) {
      var
        html = ''
      ;
      if(response[fields.results] !== undefined) {
Severity: Minor
Found in src/definitions/modules/search.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                if(isShortcutKey) {
                  var
                    $currentlySelected = $item.not(selector.unselectable).filter('.' + className.selected).eq(0),
                    $activeItem        = $menu.children('.' + className.active).eq(0),
                    $selectedItem      = ($currentlySelected.length > 0)
    Severity: Critical
    Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                selected: function(value, $selectedItem) {
                  $selectedItem = (settings.allowAdditions)
                    ? $selectedItem || module.get.itemWithAdditions(value)
                    : $selectedItem || module.get.item(value)
                  ;
      Severity: Minor
      Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                pushPage: function(callback) {
                  var
                    transition = module.get.transition(),
                    $transition = (transition === 'overlay' || module.othersActive())
                      ? $module
        Severity: Minor
        Found in src/definitions/modules/sidebar.js - About 1 hr to fix

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

            function factory() {
              function init(options,element) {
                function chkType() {
                  if(!element.tagName) {
                    throw new TypeError('Object is not a valid DOM element');
          Severity: Minor
          Found in examples/assets/library/iframe.js - About 1 hr to fix

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

                      prompt: function(identifier, errors) {
                        var
                          $field       = module.get.field(identifier),
                          $fieldGroup  = $field.closest($group),
                          $prompt      = $fieldGroup.children(selector.prompt),
            Severity: Minor
            Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

                      hideModal: function(callback, keepDimmed) {
                        callback = $.isFunction(callback)
                          ? callback
                          : function(){}
                        ;
              Severity: Minor
              Found in src/definitions/modules/modal.js - About 1 hr to fix

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

                          mockedXHR: function () {
                            var
                              // xhr does not simulate these properties of xhr but must return them
                              textStatus     = false,
                              status         = false,
                Severity: Minor
                Found in src/definitions/behaviors/api.js - About 1 hr to fix

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

                  module.exports = async function(callback) {
                  
                    console.log('Publishing main repo');
                    await npmPublish({
                      package: `./package.json`,
                  Severity: Minor
                  Found in tasks/admin/register.js - About 1 hr to fix

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

                      addDerivedValues: function(config) {
                    
                        config = config || extend(false, {}, defaults);
                    
                        /*--------------
                    Severity: Minor
                    Found in tasks/config/project/config.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 pullPage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            pullPage: function(callback) {
                              var
                                transition = module.get.transition(),
                                $transition = (transition == 'overlay' || module.othersActive())
                                  ? $module
                    Severity: Minor
                    Found in src/definitions/modules/sidebar.js - About 1 hr to fix

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

                                scrollPosition: function($item, forceScroll) {
                                  var
                                    edgeTolerance = 5,
                                    $menu,
                                    hasActive,
                      Severity: Minor
                      Found in src/definitions/modules/dropdown.js - About 1 hr to fix

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

                                  settings: function() {
                                    if($.isPlainObject(parameters)) {
                                      var
                                        keys     = Object.keys(parameters),
                                        isLegacySettings = (keys.length > 0)
                        Severity: Minor
                        Found in src/definitions/behaviors/form.js - About 1 hr to fix

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

                                    hide: function(callback) {
                                      callback = $.isFunction(callback)
                                        ? callback
                                        : function(){}
                                      ;
                          Severity: Minor
                          Found in src/definitions/modules/dimmer.js - About 1 hr to fix

                            Function label has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                      label: function(value, text, shouldAnimate) {
                                        var
                                          $next  = module.is.searchSelection()
                                            ? $search
                                            : $text,
                            Severity: Minor
                            Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                              Function sizeIFrame has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function sizeIFrame(triggerEvent, triggerEventDesc, customHeight, customWidth) {
                              
                                  function resizeIFrame() {
                                    height = currentHeight;
                                    width  = currentWidth;
                              Severity: Minor
                              Found in examples/assets/library/iframe-content.js - About 1 hr to fix

                                Function value has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                          value: function(addedValue, addedText, $selectedItem) {
                                            var
                                              currentValue = module.get.values(),
                                              newValue
                                            ;
                                Severity: Minor
                                Found in src/definitions/modules/dropdown.js - About 1 hr to fix

                                  Function click has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              click: function(event) {
                                                module.debug('Search result selected');
                                                var
                                                  $result = $(this),
                                                  $title  = $result.find(selector.title).eq(0),
                                  Severity: Minor
                                  Found in src/definitions/modules/search.js - About 1 hr to fix

                                    Function fixHiddenIFrames has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function fixHiddenIFrames() {
                                        function checkIFrames() {
                                          function checkIFrame(settingId) {
                                            function chkDimension(dimension) {
                                              return '0px' === (settings[settingId] && settings[settingId].iframe.style[dimension]);
                                    Severity: Minor
                                    Found in examples/assets/library/iframe.js - About 1 hr to fix

                                      Function refresh has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              refresh: function() {
                                                if(settings.popup) {
                                                  $popup = $(settings.popup).eq(0);
                                                }
                                                else {
                                      Severity: Minor
                                      Found in src/definitions/modules/popup.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language