Sorry, data for that comparison is no longer available.

teamdigitale/italia-app

View on GitHub
ts/components/wallet/card/CardComponent.tsx

Summary

Maintainability
C
1 day
Test Coverage

File CardComponent.tsx has 298 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Component rendering a credit card,
 * with different appearences based on
 * the props passed
 */
Severity: Minor
Found in ts/components/wallet/card/CardComponent.tsx - About 3 hrs to fix

    Function renderTopRightCorner has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private renderTopRightCorner() {
        if (this.props.type === "Preview" || this.props.type === "Picking") {
          const { wallet } = this.props;
          return (
            <View style={styles.cardLogo}>
    Severity: Major
    Found in ts/components/wallet/card/CardComponent.tsx - About 2 hrs to fix

      Function renderBody has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private renderBody(creditCard: CreditCard) {
          const { type } = this.props;
      
          if (type === "Preview") {
            return null;
      Severity: Major
      Found in ts/components/wallet/card/CardComponent.tsx - About 2 hrs to fix

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

          public render(): React.ReactNode {
            const { wallet } = this.props;
        
            const hasFlatBottom =
              this.props.type === "Preview" || this.props.type === "Header";
        Severity: Minor
        Found in ts/components/wallet/card/CardComponent.tsx - About 1 hr to fix

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

            private renderTopRightCorner() {
              if (this.props.type === "Preview" || this.props.type === "Picking") {
                const { wallet } = this.props;
                return (
                  <View style={styles.cardLogo}>
          Severity: Minor
          Found in ts/components/wallet/card/CardComponent.tsx - About 1 hr to fix

          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

          Consider simplifying this complex logical expression.
          Open

              if (this.props.type === "Header") {
                const {
                  hideFavoriteIcon,
                  isFavorite,
                  onSetFavorite,
          Severity: Major
          Found in ts/components/wallet/card/CardComponent.tsx - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  (this.props.type === "Full" || this.props.type === "Header") &&
                  this.props.onSetFavorite !== undefined &&
                  this.props.isFavorite !== undefined &&
                  !pot.isLoading(this.props.isFavorite) &&
            Severity: Major
            Found in ts/components/wallet/card/CardComponent.tsx - About 40 mins to fix

              There are no issues that match your filters.

              Category
              Status