Showing 27 of 46 total issues
File jquery.raty.js
has 574 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* jQuery Raty - A Star Rating Plugin
*
* The MIT License
*
Function gCalReader
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.gCalReader = function(options) {
var $div = $(this);
var defaults = $.extend({
calendarId: 'en.canadian#holiday@group.v.calendar.google.com',
RequestQueue
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
var RequestQueue = React.createClass({
propTypes: {
locations: React.PropTypes.array.isRequired,
user: React.PropTypes.object.isRequired
File request_queue.js.jsx
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
var RequestQueue = React.createClass({
propTypes: {
locations: React.PropTypes.array.isRequired,
user: React.PropTypes.object.isRequired
Function subscribeToSocket
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
subscribeToSocket: function() {
var that = this;
if(App.assistance)
App.assistance.unsubscribe();
Function value
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
value: function(target) {
'use strict';
if (target === undefined || target === null) {
throw new TypeError('Cannot convert first argument to 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
Class User
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ActiveRecord::Base
mount_uploader :custom_avatar, CustomAvatarUploader
belongs_to :cohort
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var assistance = this.props.assistance;
if(assistance)
var assistanceRequest = assistance.assistance_request;
Function toggle
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggle: function(trigger, element, event) {
if (event) {
event.preventDefault();
}
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var assistance = this.props.assistance;
var assistanceRequest = assistance.assistance_request;
var activitySubmission = assistanceRequest.activity_submission;
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
, render: function(){
var then = (new Date(this.props.date)).valueOf()
var now = Date.now()
var seconds = Math.round(Math.abs(now-then)/1000)
Function init
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function() {
var $this = this,
current = $(this.element);
current.data({
Function init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function(options) {
return this.each(function() {
this.self = $(this);
methods.destroy.call(this.self);
Function received
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
received: function(data) {
switch(data.type) {
case "AssistanceRequest":
that.handleAssistanceRequest(data.object);
break;
Function renderLocations
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderLocations: function() {
var that = this;
if(this.props.user.location)
return (
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
, render: function(){
var then = (new Date(this.props.date)).valueOf()
var now = Date.now()
var seconds = Math.round(Math.abs(now-then)/1000)
- 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 tick
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
, tick: function(refresh){
if(!this.isMounted() || !this.props.live){
return
}
- 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 subscribeToSocket
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
subscribeToSocket: function() {
var that = this;
if(App.assistance)
App.assistance.unsubscribe();
- 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
Method unlocked?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def unlocked?
return true if @date == 'setup'
return true if unlock_weekend_on_friday
return false unless @cohort
return false if @cohort.start_date > Date.current
- 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
Method day
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def day
return @day if @day
d = params[:number] || params[:day_number]
@day = case d
when 'today'
- 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"