Showing 30 of 214 total issues
File uncivil.ts
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Card, CardRewardType } from '../../typings'
const uncivil: Card[] = [
{
name: 'not-polite',
Function MiniGame
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const MiniGame: FC<MiniGameProps> = props => {
const { uuid, player, winner, type } = props
const [pending, setPending] = useState<PendingState>(undefined)
const [ready, setReady] = useState<boolean>(false)
const { theme, setTheme } = useTheme()
- 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"
Further reading
Function CarCounterPoints
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CarCounterPoints: FC<SvgProps> = props => {
return (
<Svg viewBox={`0 0 ${WIDTH} ${HEIGHT}`} fill="none" {...props}>
<Path
fill={Colors.beige}
Function Scan
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
const Scan = () => {
const fadeAnim = useRef(new Animated.Value(0)).current
useEffect(() => {
Animated.loop(
Function PosterSlice
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
const PosterSlice: FC = () => {
const container = useRef()
const wrapper = useRef()
const draggable = useDraggable(wrapper, {
Function panResponder
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
const panResponder = useMemo(() => {
return PanResponder.create({
onStartShouldSetPanResponder: () => true,
onPanResponderMove: (evt, gestureState) => {
if (
Function startGame
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
async startGame(_, { playerUUID }) {
const player = await Player.findByUUID(playerUUID, {
withRelated: [
'user',
'game',
Function SlideToAnswer
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Confirmed
const SlideToAnswer: FC<SlideToAnswerProps> = ({
onHangUp,
onPickUp,
touchable
}) => {
- 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"
Further reading
Function MiniGame
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MiniGame: FC<MiniGameProps> = props => {
const { uuid, player, winner, type } = props
const [pending, setPending] = useState<PendingState>(undefined)
const [ready, setReady] = useState<boolean>(false)
const { theme, setTheme } = useTheme()
Function NotificationSample
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NotificationSample = () => {
const [notification, setNotification] = useState([])
const { setTheme } = useTheme()
const mock = () => {
Function Pending
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
const Pending = () => {
return (
<>
<Component>
<Container alignSelf="center">
Function reportPlayer
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
async reportPlayer(_, { fromUUID, toUUID }) {
const [from, to] = await Promise.all(
[fromUUID, toUUID].map(uuid =>
Player.findByUUID(uuid, {
withRelated: ['game']
Function GameOver
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GameOver: FC<SvgProps> = props => {
return (
<Svg viewBox={`0 0 ${WIDTH} ${HEIGHT}`} fill="none" {...props}>
<Path
fill={Colors.red}
Function setCardRound
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
async setCardRound(_, { playerUUID, choice, targets }) {
const { game, player, players, lastRound } = await getPlayerData(
playerUUID
)
Function webpack
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
webpack(config, options) {
const { isServer } = options;
nextConfig = Object.assign({ inlineImageLimit: 8192, assetPrefix: "" }, nextConfig);
if (!options.defaultLoaders) {
Function readyForRound
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async readyForRound(_, { playerUUID }) {
const player = await Player.findByUUID(playerUUID, {
withRelated: [
'user',
'game',
Function AlertContainer
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
const AlertContainer: FC = () => {
const [alerts, setAlert] = useState<IdentifiedAlert[]>([])
useBus(
'alert',
Function ResourceSavingScene
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ResourceSavingScene: FC<Props> = props => {
// react-native-screens is buggy on web
if (screensEnabled?.() && Platform.OS !== 'web') {
const { isVisible, ...rest } = props
- 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"
Further reading
Function onPanResponderRelease
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
onPanResponderRelease: (_, gestureState) => {
if (answer) return
if (
gestureState.dx + COMPONENT_HEIGHT + RELEASE_OFFSET >
layout.current.width
Function stopGame
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async stopGame(_, { winnerUUID }) {
const winner = await Player.findByUUID(winnerUUID, {
withRelated: ['game', 'game.room', 'game.players', 'game.players.user']
})
const game = winner.related('game') as Game