Showing 12 of 50 total issues
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
return (
<div ref={this.sliderRef}>
<ScrubberWrapper>
{!this.props.hideLabel ? (
Function render
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
return (
<AudioControlsContainer>
<TimeSliderContainer>
<TimeSlider
Function render
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { classes, showSignin } = this.props
const { handleSubmit, handleChange } = this
return (
<div>
Function render
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const {
className,
results,
resultCount,
File AudioPlayer.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import styled from 'styled-components'
import React from 'react'
import { actions } from 'mirrorx'
import Mousetrap from 'mousetrap'
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { classes, showSignup } = this.props
const { handleSubmit, handleChange } = this
return (
<div>
Function eventTracking
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const eventTracking = mirror.hook((action, getState) => {
switch (action.type) {
case 'player/addToQueue':
const toAddAudioUrl = action.data.audioUrl
gtag('event', 'add_to_queue', {
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { className, history } = this.props
return (
<div className={className}>
<div className='innerContent'>
Function search
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async search (searchTerm) {
actions.search.startLoading()
const url =
config.corsProxy +
config.searchSettings.baseUrl
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const {
currentSearch,
nowPlaying,
queue,
Avoid too many return
statements within this function. Open
Open
return 0
Function eventTracking
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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) {
- 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"