teamdigitale/italia-app

View on GitHub

Showing 4,378 of 4,378 total issues

Function renderModuleAttachment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const renderModuleAttachment = (isDesignSystemEnabled: boolean) => (
  <DSComponentViewerBox name="ModuleAttachment">
    <View>
      {isDesignSystemEnabled ? (
        <ModuleAttachment
Severity: Minor
Found in ts/features/design-system/core/DSModules.tsx - About 25 mins 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

Function MessageDetailsComponent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const MessageDetailsComponent = ({
  hasPaidBadge,
  message,
  messageDetails,
  onServiceLinkPress,
Severity: Minor
Found in ts/features/messages/components/MessageDetail/index.tsx - About 25 mins 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

Function AddBPayScreen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const AddBPayScreen = (props: Props): React.ReactElement | null => {
  // next could be skip or not (a pan should be added)
  const [currentAction, setNextAction] = React.useState<NextAction>({
    index: 0,
    skip: false

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 PaymentsHomeUserMethodsList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const PaymentsHomeUserMethodsList = ({ enforcedLoadingState }: Props) => {
  const bannerRef = React.createRef<View>();

  const navigation = useIONavigation();
  const dispatch = useIODispatch();
Severity: Minor
Found in ts/features/payments/home/components/PaymentsHomeUserMethodsList.tsx - About 25 mins 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

Function CgnMerchantsFilters has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const CgnMerchantsFilters: React.FunctionComponent<Props> = (props: Props) => {
  const [searchValue, setSearchValue] = useState<string>("");
  const [address, setAddress] = useState<string>("");
  const [checkedCategories, setCheckedCategories] = useState<
    ReadonlyArray<string>
Severity: Minor
Found in ts/features/bonus/cgn/components/merchants/CgnMerchantsFilters.tsx - About 25 mins 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

Function WalletPaymentHeader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const WalletPaymentHeader = ({ currentStep }: WalletPaymentHeaderProps) => {
  const navigation = useIONavigation();
  const dispatch = useIODispatch();
  const goBackHandler = useWalletPaymentGoBackHandler();

Severity: Minor
Found in ts/features/payments/checkout/components/WalletPaymentHeader.tsx - About 25 mins 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

Function BaseCoBadgeCard has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const BaseCoBadgeCard: React.FunctionComponent<Props> = (props: Props) => {
  const imgDimensions = useImageResize(
    BASE_IMG_W,
    BASE_IMG_H,
    props.abi?.logoUrl
Severity: Minor
Found in ts/features/wallet/cobadge/component/BaseCoBadgeCard.tsx - About 25 mins 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

Function CgnOTPCodeContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const CgnOTPCodeContent = ({ onCodePress }: Props) => {
  const [isCodeVisible, setIsCodeVisible] = React.useState(false);
  const dispatch = useIODispatch();
  const otp = useIOSelector(cgnOtpDataSelector);

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 AddCoBadgeScreen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const AddCoBadgeScreen = (props: Props): React.ReactElement | null => {
  // next could be skip or not (a pan should be added)
  const [currentAction, setNextAction] = React.useState<NextAction>({
    index: 0,
    skip: false

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 CgnMerchantsListScreen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const CgnMerchantsListScreen: React.FunctionComponent<Props> = (
  props: Props
) => {
  const [searchValue, setSearchValue] = React.useState("");
  const [merchantList, setMerchantsList] = React.useState<
Severity: Minor
Found in ts/features/bonus/cgn/screens/merchants/CgnMerchantsListScreen.tsx - About 25 mins 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

Function LegacyCgnServiceCTA has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const LegacyCgnServiceCTA = (props: Props) => {
  const isFirstRender = useRef<boolean>(true);
  const dispatch = useIODispatch();
  const servicePreference = useIOSelector(servicePreferenceSelector);
  const unsubscriptionStatus = useIOSelector(cgnUnsubscribeSelector);
Severity: Minor
Found in ts/features/bonus/cgn/components/LegacyCgnServiceCTA.tsx - About 25 mins 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

Function SearchAvailableUserBPayScreen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const SearchAvailableUserBPayScreen = (props: Props): React.ReactElement => {
  useAvoidHardwareBackButton();

  const bPayAccounts = props.bPayAccounts;
  const noBPayFound = isReady(bPayAccounts) && bPayAccounts.value.length === 0;

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 WalletPaymentOutcomeScreen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const WalletPaymentOutcomeScreen = () => {
  useAvoidHardwareBackButton();

  const { params } = useRoute<WalletPaymentOutcomeRouteProps>();
  const { outcome } = params;
Severity: Minor
Found in ts/features/payments/checkout/screens/WalletPaymentOutcomeScreen.tsx - About 25 mins 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

Function CdcRequestPartiallySuccess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const CdcRequestPartiallySuccess = () => {
  const navigation = useNavigation<IOStackNavigationProp<AppParamsList>>();
  const cdcEnrollUserToBonus = useIOSelector(cdcEnrollUserToBonusSelector);

  const onExitPress = () => {
Severity: Minor
Found in ts/features/bonus/cdc/components/CdcRequestPartiallySuccess.tsx - About 25 mins 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

Function SearchStartComponent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const SearchStartComponent: React.FunctionComponent<Props> = (
  props: Props
) => {
  const locales = loadLocales(props.methodType);

Severity: Minor
Found in ts/features/wallet/onboarding/common/searchBank/SearchStartComponent.tsx - About 25 mins 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

Function getContextualHelpDataFromRouteSelector has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const getContextualHelpDataFromRouteSelector = (route: string) =>
  createSelector<
    GlobalState,
    pot.Pot<ContextualHelp, Error>,
    pot.Pot<O.Option<ScreenCHData>, Error>
Severity: Minor
Found in ts/store/reducers/content.ts - About 25 mins 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

Function FeaturedCardCarousel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const FeaturedCardCarousel: React.FunctionComponent<Props> = (props: Props) => {
  const dispatch = useIODispatch();
  const navigation = useNavigation<IOStackNavigationProp<AppParamsList>>();
  const isCgnEnabled = useIOSelector(isCGNEnabledSelector);
  const isCdcEnabled = useIOSelector(isCdcEnabledSelector);
Severity: Minor
Found in ts/features/wallet/component/card/FeaturedCardCarousel.tsx - About 25 mins 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

Function updatePrTitleForChangelog has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const updatePrTitleForChangelog = async (
  tickets: JiraTicketRetrievalResults
) => {
  if (tickets.some(E.isLeft)) {
    warn(atLeastOneLeftTicket);
Severity: Minor
Found in scripts/ts/danger/updatePrTitle.tsx - About 25 mins 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

Severity
Category
Status
Source
Language