Showing 183 of 288 total issues
Function Modernizr
has 605 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.Modernizr = (function( window, document, undefined ) {
var version = '2.7.1',
Modernizr = {},
Function Modernizr
has a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring. Open
window.Modernizr = (function( window, document, undefined ) {
var version = '2.7.1',
Modernizr = {},
- 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
File modernizr.js
has 607 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Modernizr v2.7.1
* www.modernizr.com
*
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
File forum_replacement_service.rb
has 559 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ForumReplacementService < Service
# Cool replacements we could eventually do not for pranking
# [roll N] = random number between 1 and N
# [roll N, M] = random number between N and M
# [@reader] = username of the reader
File content_controller.rb
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ContentController < ApplicationController
before_action :authenticate_user!, except: [:show, :changelog, :api_sort] \
+ Rails.application.config.content_types[:all_non_universe].map { |type| type.name.downcase.pluralize.to_sym }
skip_before_action :cache_most_used_page_information, only: [
File basil_controller.rb
has 506 lines of code (exceeds 250 allowed). Consider refactoring. Open
class BasilController < ApplicationController
before_action :authenticate_user!, except: [:complete_commission, :about, :stats, :jam, :queue_jam_job, :commission_info]
before_action :require_admin_access, only: [:review], unless: -> { Rails.env.development? }
Function RadarChart
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
function RadarChart(id, data, options) {
var cfg = {
w: 600, //Width of the circle
h: 600, //Height of the circle
margin: {top: 100, right: 100, bottom: 100, left: 100}, //The margins of the SVG
Method attribute_categories
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def self.attribute_categories(user, show_hidden: false)
# TODO: this is a code smell; we should probably either be whitelisting or fixing whatever is calling
# this with the wrong models
return [] if ['attribute_category', 'attribute_field'].include?(content_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
File js-mindmap.js
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
js-mindmap
Copyright (c) 2008/09/10 Kenneth Kufluk http://kenneth.kufluk.com/
Method content
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
def content
# Fetch the content page from our already-queried cache of current user content
@content_type = params[:content_type].humanize
@content = @current_user_content[@content_type].detect do |page|
page.id == params[:id].to_i
Method text_outline_export
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def self.text_outline_export(universe_ids)
page_types = Rails.application.config.content_types[:all]
temporary_user_id_reference = Universe.find_by(id: universe_ids).user_id
export_text = StringIO.new
- 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
Class ContentController
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class ContentController < ApplicationController
before_action :authenticate_user!, except: [:show, :changelog, :api_sort] \
+ Rails.application.config.content_types[:all_non_universe].map { |type| type.name.downcase.pluralize.to_sym }
skip_before_action :cache_most_used_page_information, only: [
Class User
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ApplicationRecord
acts_as_paranoid
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
Method text_markdown_export
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def self.text_markdown_export(universe_ids)
page_types = Rails.application.config.content_types[:all]
temporary_user_id_reference = Universe.find_by(id: universe_ids).user_id
export_text = StringIO.new
- 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 pageData
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
pageData() {
if (this.state.show_data) {
return (
<div
role="presentation"
Method json_export
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def self.json_export(universe_ids)
page_types = Rails.application.config.content_types[:all]
temporary_user_id_reference = Universe.find_by(id: universe_ids).user_id
export_object = {}
- 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 constructor
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.state = {
'open': false
Function constructor
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(el) {
this.el = el;
if (!(this.el.length > 0)) { return; }
window.editor = new MediumEditor('#editor', {
Function mindmap
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.mindmap = function (options) {
// Define default settings.
options = $.extend({
attract: 15,
repulse: 6,
File PageLookupSidebar.js
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
Usage:
<%= react_component("PageLookupSidebar", {document_id: @document.id}) %>
*/