Showing 700 of 1,230 total issues
File transaction_helper.rb
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module TransactionHelper
def icon_for(status)
case status
when "confirmed"
File community.rb
has 455 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class Community < ApplicationRecord # rubocop:disable Metrics/ClassLength
require 'compass'
require 'sass/plugin'
Function initializeManageMembers
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
Open
window.ST.initializeManageMembers = function() {
var DELAY = 800;
function createCheckboxAjaxRequest(streams, url, allowedKey, disallowedKey) {
var ajaxRequest = Bacon.combineAsArray(streams).changes().debounce(DELAY).skipDuplicates(_.isEqual).map(function(valueObjects) {
- 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 initializeSenderEmailForm
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.initializeSenderEmailForm = function(userEmail, statusCheckUrl, resendVerificationEmailUrl) {
var lastEmailState;
var updateState = function(currentEmailState) {
return ST.utils.baconStreamFromAjaxPolling(
Function add_validator_methods
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function add_validator_methods() {
/**
Take string representing number with either dot (.) or comma (,)
as decimal separator and get back number
Class TransactionsPresenter
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Admin2::TransactionsPresenter
include Collator
private
File image_uploader.js
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
window.ST = window.ST || {};
/**
Returns a new element for image uploading/preview
*/
Function initializeListingShapeForm
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.ST.initializeListingShapeForm = function(formId) {
$(formId).validate({
errorPlacement: function(error, element) {
if (element.hasClass("js-custom-unit-kind-radio")) {
error.appendTo($(".js-custom-unit-kind-container"));
Class TransactionsPresenter
has 45 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Admin::TransactionsPresenter
include Collator
private
Function render
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { location, marketplace_color1: marketplaceColor1 } = { ...DEFAULT_CONTEXT, ...this.props.marketplace };
const { loggedInUsername } = this.props.user || {};
const isAdmin = !!(this.props.user && this.props.user.isAdmin && loggedInUsername);
Method conversation_icon_and_status
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def conversation_icon_and_status(status, is_author, other_party_name, waiting_feedback, status_meta)
icon_waiting_you = icon_tag("alert", ["icon-fix-rel", "waiting-you"])
icon_waiting_other = icon_tag("clock", ["icon-fix-rel", "waiting-other"])
# Split "confirmed" status into "waiting_feedback" and "completed"
File application_controller.rb
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'will_paginate/array'
class ApplicationController < ActionController::Base
module DefaultURLOptions
File person.rb
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'json'
require 'rest_client'
require "open-uri"
# This class represents a person (a user of Sharetribe).
File transactions_controller.rb
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class TransactionsController < ApplicationController
before_action only: [:show] do |controller|
controller.ensure_logged_in t("layouts.notifications.you_must_log_in_to_view_your_inbox")
end
File stripe_form3.js
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* jshint sub: false */
/* Sripe API version 2019-02-19 */
window.ST = window.ST || {};
window.ST.stripe_form_i18n = window.ST.stripe_form_i18n || {
'account_number' : 'Account number',
Function initializeListingShapeForm
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.ST.initializeListingShapeForm = function(formId) {
$(formId).validate({
errorPlacement: function(error, element) {
if (element.hasClass("js-custom-unit-kind-radio")) {
error.appendTo($(".js-custom-unit-kind-container"));
Function initialize
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initialize() {
if (IE) {
container.find("*:not(input)").attr("unselectable", "on");
}
File merchant_actions.rb
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module PaypalService
module MerchantActions
module_function
File fastclick.js
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function () {
'use strict';
/**
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
File listing_form.js
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
window.ST = window.ST || {};
(function(module) {
/* global disable_submit_button */
/* global set_textarea_maxlength */