Showing 23 of 59 total issues
File tooltip.js
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ========================================================================
* Bootstrap: tooltip.js v3.3.6
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
Class ThemedGenerator
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class ThemedGenerator < ::Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
argument :controller_path, :type => :string
argument :model_name, :type => :string, :required => false
argument :layout, :type => :string, :default => "application",
Function show
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
Method bootstrap_flash
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def bootstrap_flash(options = {})
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 slide
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
Method add_bootstrap_breadcrumb
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def add_bootstrap_breadcrumb(name, url = '', options = {})
@__bs_breadcrumbs ||= []
class_name = options.delete(:klass) || self.class.name
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
Function backdrop
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
Function activate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
Function show
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
Method uri_state
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def uri_state(uri, options={})
return options[:status] if options.key?(:status)
root_url = request.host_with_port + '/'
root = uri == '/' || uri == root_url
- 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 applyPlacement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.applyPlacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
Function show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
Function checkPosition
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var height = this.$element.height()
var offset = this.options.offset
Function next
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
Function refresh
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
ScrollSpy.prototype.refresh = function () {
var that = this
var offsetMethod = 'offset'
var offsetBase = 0
Function hide
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
Method container_div
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def container_div(brand, brand_link, responsive, fluid, no_turbolink, &block)
Method container_div_with_block
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def container_div_with_block(brand, brand_link, responsive, no_turbolink, &block)
Method glyph
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def glyph(*names)
options = names.last.kind_of?(Hash) ? names.pop : {}
names.map! { |name| name.to_s.tr('_', '-') }
names.map! do |name|
name =~ /pull-(?:left|right)/ ? name : "glyphicon glyphicon-#{name}"
- 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"