Showing 30 of 214 total issues
Function editLastRoundTarget
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const editLastRoundTarget = async (skill: Skill) => {
// get player with related targets and rounds
const player = await skill.player().fetch({
withRelated: [
{
Function playersStatistics
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
players.map(async p => {
const player = await p.fetch({ withRelated: ['reports', 'skill'] })
const name = await getStatisticNameFromPlayer(player, {
winner,
mostTargettedPlayer
Function getStatisticNameFromPlayer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getStatisticNameFromPlayer = async (
player: Player,
{ winner, mostTargettedPlayer }: GetStatisticNameFromPlayerOptions
): Promise<StatisticName> => {
if (player.uuid === winner) {
- 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 PlayerCardStep
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const PlayerCardStep: FC<CardStepProps> = ({
player,
onCivilPress,
onUncivilPress
}) => {
- 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 CardTextContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const CardTextContent: FC<CardTextContentProps> = ({
self,
player,
targets,
card,
- 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 Home
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const Home: FC<HomeMainProps> = ({ navigation }) => {
const { setTheme } = useTheme()
const [QRcode, setQRcode] = useState(false)
const [androidNfcPopup, setAndroidNfcPopup] = useState(false)
const isNfcSupported = useRef(false)
- 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 exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = (nextConfig = {}) => {
return Object.assign({}, nextConfig, {
webpack(config, options) {
const { isServer } = options;
nextConfig = Object.assign({ inlineImageLimit: 8192, assetPrefix: "" }, nextConfig);
- 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
Avoid too many return
statements within this function. Open
else if (player.score > MOST_CIVIL_SCORE) return 'most-civil'
Avoid too many return
statements within this function. Open
return 'moderate'
Function Skill
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Skill: FC<PopupProps> = ({ set, player, players }) => {
const [confirm, setConfirm] = useState<boolean>(false)
const [skillMutation, skillMutationResponse] = useMutation(USE_SKILL_MUTATION)
const skillError = skillMutationResponse?.error?.graphQLErrors
const skillData = skillMutationResponse?.data?.useSkill
- 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"