codingblocks/qit.cloud

View on GitHub

Showing 12 of 50 total issues

Function render has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render () {
    return (
      <div ref={this.sliderRef}>
        <ScrubberWrapper>
          {!this.props.hideLabel ? (
Severity: Major
Found in website/src/components/Player/Slider.js - About 3 hrs to fix

    Function render has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render () {
        return (
          <AudioControlsContainer>
            <TimeSliderContainer>
              <TimeSlider
    Severity: Major
    Found in website/src/components/Player/AudioPlayer.js - About 3 hrs to fix

      Function render has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render () {
          const { classes, showSignin } = this.props
          const { handleSubmit, handleChange } = this
          return (
            <div>
      Severity: Major
      Found in website/src/components/Main/SignUpForm.js - About 2 hrs to fix

        Function render has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render () {
            const {
              className,
              results,
              resultCount,
        Severity: Major
        Found in website/src/components/Main/SearchResults.js - About 2 hrs to fix

          File AudioPlayer.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import styled from 'styled-components'
          import React from 'react'
          import { actions } from 'mirrorx'
          import Mousetrap from 'mousetrap'
          
          
          Severity: Minor
          Found in website/src/components/Player/AudioPlayer.js - About 2 hrs to fix

            Function render has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render () {
                const { classes, showSignup } = this.props
                const { handleSubmit, handleChange } = this
                return (
                  <div>
            Severity: Major
            Found in website/src/components/Main/SignInForm.js - About 2 hrs to fix

              Function eventTracking has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const eventTracking = mirror.hook((action, getState) => {
                switch (action.type) {
                  case 'player/addToQueue':
                    const toAddAudioUrl = action.data.audioUrl
                    gtag('event', 'add_to_queue', {
              Severity: Minor
              Found in website/src/hooks/eventTrackingHook.js - About 1 hr to fix

                Function render has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render () {
                    const { className, history } = this.props
                    return (
                      <div className={className}>
                        <div className='innerContent'>
                Severity: Minor
                Found in website/src/components/About.js - About 1 hr to fix

                  Function search has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      async search (searchTerm) {
                        actions.search.startLoading()
                        const url =
                          config.corsProxy +
                          config.searchSettings.baseUrl
                  Severity: Minor
                  Found in website/src/models/SearchModel.js - About 1 hr to fix

                    Function render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render () {
                        const {
                          currentSearch,
                          nowPlaying,
                          queue,
                    Severity: Minor
                    Found in website/src/App.js - About 1 hr to fix

                      Avoid too many return statements within this function.
                      Open

                          return 0
                      Severity: Major
                      Found in website/src/components/Player/Slider.js - About 30 mins to fix

                        Function eventTracking has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const eventTracking = mirror.hook((action, getState) => {
                          const queue = getState().player.queue
                        
                          if (action.type.startsWith('player')) {
                            if (action.type === 'player/removeFromQueue' && queue.length === 0) {
                        Severity: Minor
                        Found in website/src/hooks/saveQueueHook.js - About 25 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