Showing 18 of 122 total issues
Class AuctionShowViewModel
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class AuctionShowViewModel
attr_reader :auction, :current_user
def initialize(auction:, current_user:, bid_error: nil)
@auction = auction
- Create a ticketCreate a ticket
File charts.js
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
(function (window) {
var microp = window.microp;
- Create a ticketCreate a ticket
Class WinningBidderExport
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class WinningBidderExport
class Error < StandardError; end
PURCHASE_CARD_AS_PAYMENT_METHOD = 'Y'.freeze
NATIONAL_INTEREST_ACTION = 'None'.freeze
- Create a ticketCreate a ticket
Class AuctionShowViewModel
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Admin::AuctionShowViewModel < Admin::BaseViewModel
attr_reader :auction, :current_user
def initialize(auction:, current_user:)
@auction = auction
- Create a ticketCreate a ticket
Function chart5
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
chart5: function chart5 (settings) {
c3.generate({
bindto: '#chart5',
axis: {
x: {
- Create a ticketCreate a ticket
Class AuctionListItem
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class AuctionListItem
attr_reader :auction, :current_user
def initialize(auction:, current_user:)
@auction = auction
- Create a ticketCreate a ticket
Class BidStatusPresenterFactory
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class BidStatusPresenterFactory
attr_reader :auction, :user, :bid_error
def initialize(auction:, user:, bid_error: nil)
@auction = auction
- Create a ticketCreate a ticket
Function chart2
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
chart2: function chart2 (settings) {
c3.generate({
bindto: '#chart2',
data: {
xs: {
- Create a ticketCreate a ticket
Function chart4
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
chart4: function chart4 (settings) {
var today = new Date();
var twoWeeksAgo = new Date(today - (1000 * 60 * 60 * 24 * 14)); // 14 days ago
var dateExtent = [twoWeeksAgo,today];
- Create a ticketCreate a ticket
Function chart4
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
chart4: function chart4 (auctions) {
var settings = {};
settings.cols = [
['date_community'],
['Bidders'],
- Create a ticketCreate a ticket
Method change
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def change
create_table "auctions" do |t|
t.string "issue_url"
t.float "start_price"
t.datetime "start_datetime"
- Create a ticketCreate a ticket
Function chart2
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
chart2: function chart2 (auctions) {
var settings = {};
settings.cols = [['bids_dates'], ['bids'], ['means_dates'],['means']];
_.each(auctions, function(auction){
- Create a ticketCreate a ticket
Function chart5
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
chart5: function chart5 (auctions) {
var settings = {};
// set of columns for the scatterplot
// @format [['date_#{ auction number }', '#{ date }'],['#{ auction number }', #{ number of bids }]]
settings.cols = [];
- Create a ticketCreate a ticket
Method relative_time
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def relative_time
time_diff = (time - Time.now).to_i
abs_time_diff = time_diff.abs
if abs_time_diff < 24.hours
- Read upRead up
- Create a ticketCreate a ticket
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 available_message
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def available_message
if admin?
AdminAuctionStatusPresenter::Available
elsif guest?
BidStatusPresenter::Available::Guest
- Read upRead up
- Create a ticketCreate a ticket
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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
if auction.unpublished?
BidStatusPresenter::Unpublished::Guest
elsif future?
future_message
- Read upRead up
- Create a ticketCreate a ticket
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 perform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform
auctions.each do |auction|
next if auction.c2_proposal_url.blank? || auction.invalid?
budget_approved_at = find_approval_timestamp(proposal_json(auction))
- Read upRead up
- Create a ticketCreate a ticket
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 bid_label
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def bid_label(user)
bid = highlighted_bid(user)
amount = Currency.new(bid.amount)
if bid.is_a?(NullBid)
- Read upRead up
- Create a ticketCreate a ticket
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"