Showing 288 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
<SpeedDial
ariaLabel="SpeedDial example"
icon={<SpeedDialIcon />}
onClose={() => this.handle_close()}
onOpen={() => this.handle_open()}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 226.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<SpeedDial
ariaLabel="SpeedDial example"
icon={<SpeedDialIcon />}
onClose={() => this.handle_close()}
onOpen={() => this.handle_open()}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 226.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
$('.js-move-event-down').click(function () {
var event_container = $(this).closest('.timeline-event-container');
var event_id = event_container.data('event-id');
$.get(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 171.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$('.js-move-event-up').click(function () {
var event_container = $(this).closest('.timeline-event-container');
var event_id = event_container.data('event-id');
$.get(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 171.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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"
Similar blocks of code found in 2 locations. Consider refactoring. Open
<a href={this.content_page_view_path(this.state.page_type, this.state.page_id)}>
<ListItem button>
<i className={"blue-text material-icons left"}>
{ this.classIcon(this.state.page_type) }
</i>
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 127.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76