Showing 1,265 of 1,265 total issues
Class Person
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Person < ApplicationRecord
LOGIN_FORMAT = /\A\w[\w.+\-_@ ]+\z/.freeze
include Comparable
include Export::People
File schedule_controller_test.rb
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "test_helper"
# :stopdoc:
class ScheduleControllerTest < ActionController::TestCase #:nodoc: all
test "index" do
Method event_params
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def event_params
_params = params.require(:event).permit(
:additional_race_price,
:all_events_discount,
:atra_points_series,
File person.rb
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "sentient_user/sentient_user"
# Someone who either appears in race results or who is added as a member of a racing association
#
# Names are _not_ unique. In fact, there are many business rules about names. See Aliases and Names.
File name_test.rb
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "test_helper"
module Categories
# :stopdoc:
class NameTest < ActiveSupport::TestCase
File results_controller_test.rb
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "test_helper"
# :stopdoc:
class ResultsControllerTest < ActionController::TestCase
def setup
Method receive
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def receive(email)
post = Post.new
# Sometimes we get poorly-encoded data and New Relic chokes
NewRelic::Agent.disable_all_tracing do
Method test_group_by_age
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_group_by_age
source_results = []
athena = Models::Category.new("Athena")
clydesdale = Models::Category.new("Clydesdale")
men_5 = Models::Category.new("Men 5")
File map_source_results_to_results_test.rb
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "../v3"
module Calculations
module V3
# :stopdoc:
Function exports
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
File events_controller.rb
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Admin
# Show Schedule, add and edit Events, edit Results for Events. Promoters can view and edit their own events. Promoters can edit
# fewer fields than administrators.
class EventsController < Admin::AdminController
before_action :assign_event, only: %i[edit update]
Similar blocks of code found in 2 locations. Consider refactoring. Open
person.member_from = Time.zone.local(2001, 1, 1)
person.member_to = Time.zone.local(2001, 12, 31)
assert_equal(false, person.member?, "member?")
assert_equal(false, person.member?(Time.zone.local(2000, 12, 31)), "member")
assert_equal(true, person.member?(Time.zone.local(2001, 1, 1)), "member")
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 94.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
person.member_from = Time.zone.local(2001, 1, 1)
person.member_to = Time.zone.local(2001, 12, 31)
assert_equal(false, person.member?, "member?")
assert_equal(false, person.member?(Time.zone.local(2000, 12, 31)), "member")
assert_equal(true, person.member?(Time.zone.local(2001, 1, 1)), "member")
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 94.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
test "index with alias" do
FactoryBot.create(:discipline)
FactoryBot.create(:mtb_discipline)
FactoryBot.create(:number_issuer)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 93.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
test "mtb index" do
FactoryBot.create(:discipline)
FactoryBot.create(:mtb_discipline)
FactoryBot.create(:number_issuer)
year = 2006
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 93.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Class CalculatorTest
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class CalculatorTest < CalculationsTest
def test_calculate_with_no_source_results
assert_equal [], Calculator.calculate([])
end
Method test_last_result_should_break_tie_different_dates
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_last_result_should_break_tie_different_dates
source_results = [
result(points: 355, participant_id: 1, scores: [
{ numeric_place: 1, points: 30, date: Date.new(2015, 9, 13) },
{ numeric_place: 1, points: 30, date: Date.new(2015, 9, 13) },
Method merge
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def merge(other_person, force: false)
# Consider just using straight SQL for this --
# it's not complicated, and the current process generates an
# enormous amount of SQL
Method person_params
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def person_params
params.require(:person).permit(
:administrator,
:billing_city,
:billing_country_code,
File place_test.rb
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative "../../v3"
module Calculations
module V3
module Steps