Showing 446 of 1,255 total issues
Function masonryDefinition
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function masonryDefinition( Outlayer, getSize ) {
// create an Outlayer layout class
var Masonry = Outlayer.create('masonry');
Masonry.prototype._resetLayout = function() {
Class Task
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Task < Wip
belongs_to :locker, class_name: 'User', foreign_key: 'locked_by'
has_many :deliverables, foreign_key: 'wip_id'
alias_method :design_deliverables, :deliverables
Function circle
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.geo.circle = function() {
function circle() {}
function visible(point) {
return arc.distance(point) < radians;
}
Class QueryMarks
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class QueryMarks
INHERITED_TAGS_PRODUCTS_TO_WIPS = 0.04
INHERITED_TAGS_WIPS_TO_PRODUCTS = 0.2
Class ProductsController
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ProductsController < ProductController
respond_to :html, :json
before_action :authenticate_user!, only: [:new, :create, :edit, :update, :follow, :unfollow, :announcements, :welcome]
before_action :set_product,
Function tree
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3.layout.tree = function() {
function tree(d, i) {
function firstWalk(node, previousSibling) {
var children = node.children, layout = node._tree;
if (children && (n = children.length)) {
Function EasyPieChart
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var EasyPieChart = function(el, opts) {
var defaultOptions = {
barColor: '#ef1e25',
trackColor: '#f9f9f9',
scaleColor: '#dfe0e0',
Class FilterWipsQuery
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class FilterWipsQuery
attr_accessor :product_wips, :user, :filters
def self.call(product_wips, user, filters)
new(product_wips, user, filters).filter_wips
Class Transactions
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Transactions
SATOSHIS=100_000_000
def get_btc_balance(public_address)
File products_controller.rb
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'timed_set'
require 'csv'
OPEN_ASSETS_NAME_SHORT_CHAR_LIMIT = 10
Function data
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
d3_selectionPrototype.data = function(value, key) {
function bind(group, groupData) {
var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), n1 = Math.max(n, m), updateNodes = [], enterNodes = [], exitNodes = [], node, nodeData;
if (key) {
var nodeByKeyValue = new d3_Map, keyValues = [], keyValue, j = groupData.length;
Function tree
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tree(d, i) {
function firstWalk(node, previousSibling) {
var children = node.children, layout = node._tree;
if (children && (n = children.length)) {
var n, firstChild = children[0], previousChild, ancestor = firstChild, child, i = -1;
Function render
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let product = this.state.product;
let slug = product.slug;
let user = UserStore.getUser();
let trust = null;
Function defineGetSize
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function defineGetSize( getStyleProperty ) {
// -------------------------- box sizing -------------------------- //
var boxSizingProp = getStyleProperty('boxSizing');
Class ApplicationController
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :store_location
before_action :validate_confirmed!, if: :signed_in?
Function axis
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
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_;
var subticks = d3_svg_axisSubdivide(scale, ticks, tickSubdivide), subtick = g.selectAll(".minor").data(subticks, String), subtickEnter = subtick.enter().insert("line", "g").attr("class", "tick minor").style("opacity", 1e-6), subtickExit = d3.transition(subtick.exit()).style("opacity", 1e-6).remove(), subtickUpdate = d3.transition(subtick).style("opacity", 1);
Function initZoom
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initZoom: function() {
var zoomSt = mfp.st.zoom,
ns = '.zoom',
image;
Function initZoom
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initZoom: function() {
var zoomSt = mfp.st.zoom,
ns = '.zoom',
image;
Function getImage
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getImage: function(item, template) {
var guard = 0,
// image load complete handler
Method publish!
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.publish!(opts)
bridge = opts.delete(:bridge)
create!(opts).tap do |a|
if a.publishable
if Story.should_publish?(a)
- 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"