tnantoka/konnyaku

View on GitHub

Showing 7 of 38 total issues

File bootstrap.js has 1514 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.3.1
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
Severity: Major
Found in public/bootstrap/js/bootstrap.js - About 4 days to fix

    Function slide has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      , slide: function (type, next) {
          var $active = this.$element.find('.item.active')
            , $next = next || $active[type]()
            , isCycling = this.interval
            , direction = type == 'next' ? 'left' : 'right'
    Severity: Minor
    Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

      Method bootstrap_flash has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def bootstrap_flash
          flash_messages = []
          flash.each do |type, message|
            # Skip empty messages, e.g. for devise messages set to nothing in a locale file.
            next if message.blank?
      Severity: Minor
      Found in app/helpers/bootstrap_flash_helper.rb - 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 show has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        , show: function () {
            var $tip
              , pos
              , actualWidth
              , actualHeight
      Severity: Minor
      Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

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

          , applyPlacement: function(offset, placement){
              var $tip = this.tip()
                , width = $tip[0].offsetWidth
                , height = $tip[0].offsetHeight
                , actualWidth
        Severity: Minor
        Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

          Function keydown has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            , keydown: function (e) {
                var $this
                  , $items
                  , $active
                  , $parent
          Severity: Minor
          Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

            Method lang_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def lang_list(post, labeled: true)
                list = ''
                post.langs.each do |lang|
                  label = labeled ? "<span class=\"label\">#{t(lang.code)}</span>".html_safe : t(lang.code)
                  list << "<li class=\"#{lang == current_lang ? 'active' : ''}\">#{link_to(label, post_path(post, l: lang.code))}</li>"
            Severity: Minor
            Found in app/helpers/posts_helper.rb - About 25 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

            Severity
            Category
            Status
            Source
            Language