Showing 20 of 244 total issues
File index.ts
has 3879 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Code generated by Prisma (prisma@1.30.1). DO NOT EDIT.
// Please don't change this file manually but run `prisma generate` to update it.
// For more information, please read the docs: https://www.prisma.io/docs/prisma-client/
import { DocumentNode } from "graphql";
File prisma-schema.ts
has 2712 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Code generated by Prisma (prisma@1.30.1). DO NOT EDIT.
// Please don't change this file manually but run `prisma generate` to update it.
// For more information, please read the docs: https://www.prisma.io/docs/prisma-client/
export const typeDefs = /* GraphQL */ `type AggregateCard {
Function addCard
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function addCard(card: any, set: any, skipRetry: boolean = false) {
try {
console.log(`Adding card ${card.name}`);
const uuid: string = card.uuid;
const data: CardCreateInput = {
Function ActiveFilters
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ActiveFilters: React.FC<Props> = (props: Props) => {
const {
colors,
colorIdentities,
cardName,
Function CardSearchFilterLayout
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CardSearchFilterLayout: React.FC<Props> = (props: Props) => {
const {
onSubmitFilter,
cardName,
setCardName,
Function Welcome
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Welcome: React.FC<Props> = (props: Props) => {
const { navigation } = props;
const { user } = useSelector(authSelector);
const { t } = useTranslation();
const styles = WelcomeStyles;
Function addCard
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export async function addCard(card: any, set: any, skipRetry: boolean = false) {
try {
console.log(`Adding card ${card.name}`);
const uuid: string = card.uuid;
const data: CardCreateInput = {
- 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 CardDetails
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CardDetails: React.FC<Props> = (props: Props) => {
const { card } = props.route.params;
const {
name,
manaCost,
Function ManaCheckboxRow
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ManaCheckboxRow: React.FC<Props> = (props: Props) => {
const { colors, setColors } = props;
function handleSelectColor(color: Color): void {
if (colors.includes(color)) {
return setColors(colors.filter(elem => elem != color));
Function addToken
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function addToken(token: any, set: any) {
try {
console.log(`Adding Token ${token.name}`);
const uuid: string = token.uuid;
const data: TokenCreateInput = {
Function ActiveFilters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const ActiveFilters: React.FC<Props> = (props: Props) => {
const {
colors,
colorIdentities,
cardName,
- 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 Button
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Button: React.FC<ButtonProps> = (props: ButtonProps) => {
const [state, setState] = useSetStateIfMounted<ButtonState>(ButtonState.IDLE);
async function avoidClickingWhenPromiseIsResolving(): Promise<void> {
try {
Function CardSearchFilter
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CardSearchFilter: React.FC<Props> = (props: Props) => {
const [cardName, setCardName] = useState('');
const [supertype, setSupertype] = useState('');
const [subtype, setSubtype] = useState('');
const [colors, setColors] = useState<Array<Color>>([]);
Function Welcome
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Welcome: React.FC = () => {
const [
email,
password,
setEmail,
Function useAuth
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function useAuth(): UseAuthType {
const dispatch = useDispatch();
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
Function ManaCost
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const ManaCost: React.FC<Props> = ({ manaCost }: Props) => {
const curlyBracesRegex = /[{}]+/;
const manaStrings = manaCost.split(curlyBracesRegex).filter(mana => !!mana);
const manaSymbols = manaStrings.map(
(manaString: string): Mana => new Mana(manaString),
- 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 sampleCardListFiltered
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const sampleCardListFiltered = (_, { filter }) => {
const { cardName, supertype, subtype, colors, colorIdentities } = filter
const byCardName = (card) => {
if (!cardName) {
return true
- 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 Button
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const Button: React.FC<ButtonProps> = (props: ButtonProps) => {
const [state, setState] = useSetStateIfMounted<ButtonState>(ButtonState.IDLE);
async function avoidClickingWhenPromiseIsResolving(): Promise<void> {
try {
- 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
return Colors.numberManaBackground;
Avoid too many return
statements within this function. Open
return Colors.greenManaBackground;