skyderby/skyderby

View on GitHub

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
Severity: Minor
Found in app/models/velocity.rb - About 45 mins to fix

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,

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
Severity: Minor
Found in app/models/tracks/summary/horizontal_speed_summary.rb - About 45 mins to fix

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
Severity: Minor
Found in app/models/tracks/summary/glide_ratio_summary.rb - About 45 mins to fix

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 = (
Severity: Minor
Found in app/javascript/components/Users/ForgotPassword/index.tsx - About 45 mins to fix

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 = {}) {
Severity: Minor
Found in app/javascript/utils/designated_lane.js - About 45 mins to fix

Function getSpeed has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  gpsTime: Date,
  distance: number | undefined,
  time: number | undefined,
  endTime: Date,
  result?: number

Function updateChart has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  ctx: CanvasRenderingContext2D,
  paths: PlayerPoint[][],
  rangeFrom: number,
  rangeTo: number,
  distanceRange: { min: number; max: number }

Function getChartCoordinates has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  altitude: number,
  distance: number,
  rangeFrom: number,
  rangeTo: number,
  distanceRange: { min: number; max: number }

Method perform has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def perform(attacher_class, record_class, record_id, name, file_data)
Severity: Minor
Found in app/jobs/attachment/promote_job.rb - About 35 mins to fix

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}"
Severity: Minor
Found in app/presenters/events/scoreboards/results/collection.rb - About 35 mins to fix

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 = {},
Severity: Minor
Found in app/javascript/components/Map/index.tsx - About 35 mins to fix

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)

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]

Severity: Minor
Found in app/javascript/components/FlightProfiles/utils.ts - About 35 mins to fix

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) => {
Severity: Minor
Found in app/javascript/components/AltitudeRangeSelect/index.tsx - About 35 mins to fix

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>()
Severity: Minor
Found in app/javascript/components/Places/PlacesIndex/index.tsx - About 35 mins to fix

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?
Severity: Minor
Found in app/controllers/api/v1/suits_controller.rb - About 35 mins to fix

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) => {
Severity: Minor
Found in app/javascript/components/OnlineRankings/GroupShow/ActionsBar/index.tsx - About 35 mins to fix

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],

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)

Severity: Minor
Found in app/controllers/track_files_controller.rb - About 35 mins to fix

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

Severity
Category
Status
Source
Language