blurtech/blurred-board

View on GitHub

Showing 92 of 92 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

if (state.length > history.length) {
return state.map((round: IRound) => {
if (history.some((i: IRound) => i.round === round.round)) {
return {
...round,
Severity: Major
Found in src/classes/services/BoardStoreService.ts and 1 other location - About 3 hrs to fix
src/classes/services/BoardStoreService.ts on lines 59..70

Similar blocks of code found in 2 locations. Consider refactoring.
Open

} else {
return history.map((round: IRound) => {
if (state.some((i: IRound) => i.round === round.round)) {
return {
...round,
Severity: Major
Found in src/classes/services/BoardStoreService.ts and 1 other location - About 3 hrs to fix
src/classes/services/BoardStoreService.ts on lines 48..59

Similar blocks of code found in 2 locations. Consider refactoring.
Open

{notifications ? (
<Notification
className={styles.notifications}
onClick={() => {
setNextState({
Severity: Major
Found in src/components/Settings/Settings.tsx and 1 other location - About 3 hrs to fix
src/components/Settings/Settings.tsx on lines 47..64

Similar blocks of code found in 2 locations. Consider refactoring.
Open

{sound ? (
<Sound
className={styles.sound}
onClick={() => {
setNextState({
Severity: Major
Found in src/components/Settings/Settings.tsx and 1 other location - About 3 hrs to fix
src/components/Settings/Settings.tsx on lines 29..46

Function InfoCell has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

const InfoCell = (props: IProps) => {
const { commandData, commandPlace, flagPoints } = props
 
return (
<div
Severity: Minor
Found in src/components/Board/CommandRow/InfoCell/InfoCell.tsx - About 2 hrs to fix

Function InfoCell has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const InfoCell = (props: IProps) => {
const { commandData, commandPlace, flagPoints } = props
 
return (
<div
Severity: Major
Found in src/components/Board/CommandRow/InfoCell/InfoCell.tsx - About 2 hrs to fix

    Function Settings has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Settings = (props: IProps) => {
    const { notifications, sound } = props
    const state = getState()
    const [show, setShow] = React.useState<boolean>(false)
     
     
    Severity: Major
    Found in src/components/Settings/Settings.tsx - About 2 hrs to fix

      Function ServiceCell has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const ServiceCell = (props: IProps) => {
      const { totalFlags, serviceData, firstblood } = props
      const [fbAnimation, setFbAnimation] = React.useState<boolean>(false)
       
      React.useEffect(() => {
      Severity: Minor
      Found in src/components/Board/CommandRow/ServiceCell/ServiceCell.tsx - About 1 hr to fix

        Function calculateGraphicsData has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const calculateGraphicsData = (): IGraphics[] => {
        const history = getState().history
        const teams: Array<any> = []
        history.forEach(round =>
        round.scoreboard.map(team => {
        Severity: Minor
        Found in src/classes/models/ICurrent.ts - About 1 hr to fix

          Function init has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const init = () => {
          const ws = new WebSocket(settings.wsServer)
          ws.onopen = () => {
          Logger.info('Websocket connection established')
          toast.info('Websocket connection established')
          Severity: Minor
          Found in src/classes/ws/WSClient.ts - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            case TimeStatus.Before:
            return (
            <span className={styles.timerText}>
            Starts in:
            {remainingTime ? (
            Severity: Major
            Found in src/components/shared/Timer.tsx and 1 other location - About 1 hr to fix
            src/components/shared/Timer.tsx on lines 80..90

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            case TimeStatus.Now:
            return (
            <span className={styles.timerText}>
            Time left:
            {remainingTime ? (
            Severity: Major
            Found in src/components/shared/Timer.tsx and 1 other location - About 1 hr to fix
            src/components/shared/Timer.tsx on lines 69..79

            Function getRemainingTime has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const getRemainingTime = (timeStatus: TimeStatus, remainingTime: ITime) => {
            switch (timeStatus) {
            case TimeStatus.Before:
            return (
            <span className={styles.timerText}>
            Severity: Minor
            Found in src/components/shared/Timer.tsx - About 1 hr to fix

              Function historyMap has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              const historyMap = (state: IHistory, history: IHistory) => {
              if (state.length > history.length) {
              return state.map((round: IRound) => {
              if (history.some((i: IRound) => i.round === round.round)) {
              return {
              Severity: Minor
              Found in src/classes/services/BoardStoreService.ts - About 1 hr to fix

              Function CommandRow has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const CommandRow = (props: IProps) => {
              const { servicesAmount, commandPlace, commandData, firstblood } = props
               
              return (
              <div className={styles.commandRow}>
              Severity: Minor
              Found in src/components/Board/CommandRow/CommandRow.tsx - About 1 hr to fix

                Function Header has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Header = (props: IProps) => {
                const { info } = props
                const [services, setServices] = React.useState<string[]>()
                 
                React.useEffect(() => {
                Severity: Minor
                Found in src/components/Header/Header.tsx - About 1 hr to fix

                  Function Flags has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const Flags = (props: IProps) => {
                  const { serviceData, totalFlags } = props
                   
                  return (
                  <div>
                  Severity: Minor
                  Found in src/components/Board/CommandRow/ServiceCell/Flags/Flags.tsx - About 1 hr to fix

                    Selector cellInfoWrapShow should be written in lowercase with hyphens
                    Open

                    .cellInfoWrapShow {

                    Properties should be ordered background, background-size, bottom, content, display, height, left, position, right, top, width
                    Open

                    content: '';

                    Properties should be ordered fill, height, width
                    Open

                    width: 35px;
                    Severity
                    Category
                    Status
                    Source
                    Language