halma-telegram-bot/src/Game/Halma/TelegramBot/Controller.hs

Summary

Maintainability
Test Coverage

Redundant do
Open

      _ -> do
        sendI18nMsg hlCantStartNewRoundBecauseNoMatch

Found

do sendI18nMsg hlCantStartNewRoundBecauseNoMatch

Perhaps

sendI18nMsg hlCantStartNewRoundBecauseNoMatch

Redundant do
Open

      _ -> do
        sendI18nMsg (flip hlCantUndo (Just CantUndoNoGame))

Found

do sendI18nMsg (flip hlCantUndo (Just CantUndoNoGame))

Perhaps

sendI18nMsg (flip hlCantUndo (Just CantUndoNoGame))

Use fewer imports
Open

import Control.Monad (void, when)

Found

import Control.Monad ( void, when )
import Control.Monad ( unless )

Perhaps

import Control.Monad ( void, when, unless )

Redundant do
Open

          Nothing -> do
            sendI18nMsg (flip hlCantUndo Nothing)

Found

do sendI18nMsg (flip hlCantUndo Nothing)

Perhaps

sendI18nMsg (flip hlCantUndo Nothing)

Redundant bracket
Open

handleCommand call@(CmdCall { cmdCallName = cmd }) = do

Found

(CmdCall{cmdCallName = cmd})

Perhaps

CmdCall{cmdCallName = cmd}

Redundant do
Open

    Nothing -> do
      sendMsg $ textMsg $
        "Can't identify sender of move command " <> showMoveCmd moveCmd <> "!"

Found

do sendMsg $
     textMsg $
       "Can't identify sender of move command " <>
         showMoveCmd moveCmd <> "!"

Perhaps

sendMsg $
  textMsg $
    "Can't identify sender of move command " <>
      showMoveCmd moveCmd <> "!"

Unused LANGUAGE pragma
Open

{-# LANGUAGE LambdaCase #-}

Found

{-# LANGUAGE LambdaCase #-}

Perhaps

Redundant do
Open

            Right afterMove -> do
              handleAfterMove match game afterMove

Found

do handleAfterMove match game afterMove

Perhaps

handleAfterMove match game afterMove

Use section
Open

        sendI18nMsg (flip hlCantUndo (Just CantUndoNoGame))

Found

(flip hlCantUndo (Just CantUndoNoGame))

Perhaps

(`hlCantUndo` (Just CantUndoNoGame))

Use section
Open

      in sendI18nMsg (flip hlAIMove moveByAi)

Found

(flip hlAIMove moveByAi)

Perhaps

(`hlAIMove` moveByAi)

Reduce duplication
Open

            let
              match' = match { matchCurrentGame = Just game' }

Found

let match' = match{matchCurrentGame = Just game'}
modify $ \ chat -> chat{hcMatchState = MatchRunning match'}
sendMatchState

Perhaps

Combine with halma-telegram-bot/src/Game/Halma/TelegramBot/Controller.hs:228:7

Use section
Open

    sendI18nMsg (flip hlUnrecognizedCmdMsg call)

Found

(flip hlUnrecognizedCmdMsg call)

Perhaps

(`hlUnrecognizedCmdMsg` call)

Use section
Open

          sendI18nMsg (flip hlNotYourTurn notYourTurnInfo)

Found

(flip hlNotYourTurn notYourTurnInfo)

Perhaps

(`hlNotYourTurn` notYourTurnInfo)

Use section
Open

            sendI18nMsg (flip hlCantUndo Nothing)

Found

(flip hlCantUndo Nothing)

Perhaps

(`hlCantUndo` Nothing)

There are no issues that match your filters.

Category
Status