Showing 7 of 38 total issues
File bootstrap.js
has 1514 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* ===================================================
* bootstrap-transition.js v2.3.1
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
Function slide
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, slide: function (type, next) {
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'
Method bootstrap_flash
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
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?
- Read upRead up
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
Open
, show: function () {
var $tip
, pos
, actualWidth
, actualHeight
Function applyPlacement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, applyPlacement: function(offset, placement){
var $tip = this.tip()
, width = $tip[0].offsetWidth
, height = $tip[0].offsetHeight
, actualWidth
Function keydown
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, keydown: function (e) {
var $this
, $items
, $active
, $parent
Method lang_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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>"
- Read upRead up
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"