Showing 446 of 1,255 total issues
Function open
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
open: function(data) {
if(!_body) {
_body = $(document.body);
}
Function open
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
open: function(data) {
var i;
if(data.isObj === false) {
Function path
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.geo.path = function() {
function path(d, i) {
if (typeof pointRadius === "function") pointCircle = d3_path_circle(pointRadius.apply(this, arguments));
pathType(d);
var result = buffer.length ? buffer.join("") : null;
File start_page.js.jsx
has 402 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var Accordion = require('./ui/accordion.js.jsx');
var Spinner = require('./spinner.js.jsx');
var TextPost = require('./ui/text_post.js.jsx')
var Tile = require('./ui/tile.js.jsx')
var Button = require('./ui/button.js.jsx')
Function treemap
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.layout.treemap = function() {
function scale(children, k) {
var i = -1, n = children.length, child, area;
while (++i < n) {
area = (child = children[i]).value * (k < 0 ? 0 : k);
File user.rb
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'activerecord/uuid'
require 'avatar'
require 'stripe'
class User < ActiveRecord::Base
File news_feed_item_comments.js.jsx
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// TODO This lib is in application.js (chrislloyd)
// var marked = require('marked')
var ActivityFeedComment = require('../activity_feed_comment.js.jsx');
var BountyStore = require('../../stores/bounty_store');
Function axis
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.svg.axis = function() {
function axis(g) {
g.each(function() {
var g = d3.select(this);
var ticks = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments_) : scale.domain() : tickValues, tickFormat = tickFormat_ == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments_) : String : tickFormat_;
Class Idea
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Idea < ActiveRecord::Base
include ActiveRecord::UUID
include Kaminari::ActiveRecordModelExtension
extend FriendlyId
Function zoom
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.behavior.zoom = function() {
function zoom() {
this.on("mousedown.zoom", mousedown).on("mousewheel.zoom", mousewheel).on("mousemove.zoom", mousemove).on("DOMMouseScroll.zoom", mousewheel).on("dblclick.zoom", dblclick).on("touchstart.zoom", touchstart).on("touchmove.zoom", touchmove).on("touchend.zoom", touchstart);
}
function location(p) {
File import_page.js.jsx
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var Accordion = require('./ui/accordion.js.jsx');
var Spinner = require('./spinner.js.jsx');
var TextPost = require('./ui/text_post.js.jsx')
var Tile = require('./ui/tile.js.jsx')
var Button = require('./ui/button.js.jsx')
File news_feed_item.js.jsx
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
const ActivityFeedComment = require('../activity_feed_comment.js.jsx');
const AppIcon = require('../app_icon.js.jsx');
const ArchivedNewsFeedItemsStore = require('../../stores/archived_news_feed_items_store');
Function CanvasRenderer
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var CanvasRenderer = function(el, options) {
var cachedBackground;
var canvas = document.createElement('canvas');
el.appendChild(canvas);
File bounty.js.jsx
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
const AvatarWithUsername = require('./ui/avatar_with_username.js.jsx');
const BountyActionCreators = require('../actions/bounty_actions');
const BountyStore = require('../stores/bounty_store');
Function chord
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.layout.chord = function() {
function relayout() {
var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
chords = [];
groups = [];
Function renderPageButtons
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
Open
renderPageButtons() {
var currentPage = this.state.currentPage;
var maxPages = this.props.maxPages;
var totalPages = this.state.totalPages;
- 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 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
super()
this.dispatchToken = Dispatcher.register((action) => {
switch(action.type) {
Function value
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
value: function(target, firstSource) {
"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
Function brushstart
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function brushstart() {
function mouse() {
var touches = d3.event.changedTouches;
return touches ? d3.touches(target, touches)[0] : d3.mouse(target);
}
Function dispatchToken
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.dispatchToken = Dispatcher.register((action) => {
switch(action.type) {
case ActionTypes.COMMENT_ADDED:
var comment = action.data
_heartables[comment.id] = {