Showing 131 of 843 total issues
Method value_to_decimal
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def value_to_decimal(value)
if value.instance_of?(BigDecimal)
value
elsif value.instance_of?(Float)
float_val = value.nan? || value.infinite? ? 0.0 : value
- 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
Function drawPath
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx: CanvasRenderingContext2D,
points: PlayerPoint[],
color: string,
rangeFrom: number,
rangeTo: number,
- Create a ticketCreate a ticket
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(points, zerowind_points, track_distance, zero_wind_track_distance, time, presenter) # rubocop:disable Metrics/ParameterLists
- Create a ticketCreate a ticket
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(points, zerowind_points, track_elevation, track_distance, zero_wind_distance, presenter) # rubocop:disable Metrics/ParameterLists
- Create a ticketCreate a ticket
Function ForgotPassword
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const ForgotPassword = () => {
const { t } = useI18n()
const [submitted, setSubmitted] = useState(false)
const mutation = useResetPasswordMutation()
const handleSubmit = (
- 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
Function default
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function (google, map, width, length, direction, opts = {}) {
- Create a ticketCreate a ticket
Function getSpeed
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
gpsTime: Date,
distance: number | undefined,
time: number | undefined,
endTime: Date,
result?: number
- Create a ticketCreate a ticket
Function updateChart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ctx: CanvasRenderingContext2D,
paths: PlayerPoint[][],
rangeFrom: number,
rangeTo: number,
distanceRange: { min: number; max: number }
- Create a ticketCreate a ticket
Function getChartCoordinates
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
altitude: number,
distance: number,
rangeFrom: number,
rangeTo: number,
distanceRange: { min: number; max: number }
- Create a ticketCreate a ticket
Method perform
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def perform(attacher_class, record_class, record_id, name, file_data)
- Create a ticketCreate a ticket
Method lookup_key
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def lookup_key(round: nil, section: nil, competitor: nil) # rubocop:disable Metrics/PerceivedComplexity,Metrics/CyclomaticComplexity
if round && section
"#{round.id}-#{section.id}"
elsif round && competitor
"#{round.id}-#{competitor.id}"
- 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
Function Map
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Map = (props: MapProps) => {
const {
children,
autoFitBounds = false,
options = {},
- 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
Function ResultCells
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ResultCells = ({ event, result, points }: ResultCellsProps) => {
const { t } = useI18n()
const [showResultModal, setShowResultModal] = useState(false)
const hideResultModal = () => setShowResultModal(false)
const { data: competitor } = useCompetitorQuery(event.id, result?.competitorId)
- 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
Function getTerrainElevation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getTerrainElevation = (measurements: MeasurementRecord[], distance: number) => {
for (let idx = 0; idx < measurements.length - 1; idx++) {
const prevRecord = measurements[idx]
const nextRecord = measurements[idx + 1]
- 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
Function AltitudeRangeSelect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const AltitudeRangeSelect = ({
trackId,
value: initialValue,
onChange: onChangeCallback
}: AltitudeRangeSelectProps) => {
- 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
Function PlacesIndex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const PlacesIndex = () => {
const navigate = useNavigate()
const infoWindowRef = useRef()
const markers = useRef<(google.maps.Marker & { placeId: number })[]>([])
const [map, setMap] = useState<google.maps.Map | undefined>()
- 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 apply_filters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_filters(relation)
relation
.then { |rel| params[:ids].present? ? rel.where(id: params[:ids]) : rel }
.then do |rel|
if params[:manufacturer_id].present?
- 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
Function ActionsBar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ActionsBar = ({ tasks, selectedTask, windCancellation }: Props) => {
const { t } = useI18n()
const location = useLocation()
const buildUrl = (task: string, windCancellation: boolean) => {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create
authorize @event, :update?
@assignment = @event.reference_point_assignments.find_or_initialize_by(
round_id: assignment_params[:round_id],
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create
authorize Track
@track_file = Track::File.new(track_file_params)
- 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"