Showing 58 of 126 total issues
Function expose
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
expose : function () {
var expose,
exposeCover,
el,
origCSS,
Function toggle
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggle: function() {
var self = this;
var topbar = $('.top-bar, [data-topbar]'),
section = topbar.find('section, .section');
Function set_active_from_hash
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
set_active_from_hash: function() {
var self = Foundation.libs.section,
hash = window.location.hash.substring(1),
sections = $(self.settings.section_selector);
Function un_expose
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
un_expose : function () {
var exposeId,
el,
expose ,
origCSS,
Function show
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show : function (el, css) {
// is modal
if (css) {
if (el.parent('body').length === 0) {
var placeholder = el.wrap('<div style="display: none;" />').parent();
Function _goto
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self._goto = function(next_idx, start_timer) {
// if (locked) {return false;}
if (next_idx === idx) {return false;}
if (typeof timer === 'object') {timer.restart();}
var slides = slides_container.children();
Function init
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init : function (section, method, options) {
Foundation.inherit(this, 'data_options addCustomRule');
var self = this;
if (typeof method === 'object') {
Function Timer
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Timer = function(el, settings, callback) {
var self = this,
duration = settings.timer_speed,
progress = el.find('.'+settings.timer_progress_class),
start,
Function open
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
open : function (target, ajax_settings) {
if (target) {
if (typeof target.selector !== 'undefined') {
var modal = $('#' + target.data('reveal-id'));
} else {
Method minmax
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def minmax(game_state, depth, lower_bound, upper_bound)
return evaluate_state(game_state, depth) if game_state.over?
candidate_move_nodes = []
game_state.available_moves.each do |move|
child_board = game_state.make_move(move)
- 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 reposition
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reposition : function (target, tip, classes) {
var width, nub, nubHeight, nubWidth, column, objPos;
tip.css('visibility', 'hidden').show();
Function init
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init : function (scope, method, options) {
Foundation.inherit(this, 'data_options');
var self = this;
if (typeof method === 'object') {
Function events
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
events : function () {
var self = this;
$(this.scope)
.on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) {
Function start
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
start : function () {
var self = this,
$this = $(this.scope).find('[data-joyride]'),
integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'],
int_settings_count = integer_settings.length;
Function swipe_events
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
swipe_events : function () {
var self = this;
$(this.scope)
.on('touchstart.fndtn.clearing', '.visible-img', function(e) {
Method check_line
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def check_line(candidate_space, line_id)
return if @imposible_lines.include?(line_id)
candidate = @board.contents_of(candidate_space)
return unless candidate
line = [candidate_space]
- 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 events
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
events : function () {
var self = this;
$(this.scope)
.on('click.fndtn.dropdown', '[data-dropdown]', function (e) {
Function build_markup
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.build_markup = function() {
slides_container.wrap('<div class="'+settings.container_class+'"></div>');
container = slides_container.parent();
slides_container.addClass(settings.slides_container_class);
Function hide
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
hide : function (el, css) {
// is modal
if (css) {
if (/pop/i.test(this.settings.animation)) {
var end_css = {
Function events
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
events : function () {
var self = this;
$(this.scope)
.on('click.fndtn.clearing', 'ul[data-clearing] li',