Skip to content

Ootb views demo omni #666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: evan/feature/embedded
Choose a base branch
from
Open

Conversation

evantk91
Copy link
Contributor

🔹 JIRA Ticket(s) if any

✏️ Description

Please provide a brief description of what this pull request does.

Copy link

codeclimate bot commented Jun 17, 2025

16 new issues

Tool Category Rule Count
qlty Duplication Found 76 lines of identical code in 2 locations (mass = 582) 6
qlty Structure Function with high complexity (count = 56): IterableBannerView 6
qlty Structure High total complexity (count = 56) 2
qlty Duplication Found 45 lines of similar code in 2 locations (mass = 137) 2

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

Comment on lines +1 to +75
// @ts-nocheck
import React from 'react'
import {
View,
Text,
Image,
TouchableOpacity
} from 'react-native'
import {
containerProps,
imageProps,
titleLabelProps,
subTitleLabelProps,
btnPrimaryProps,
btnSecondaryProps
} from '../types/commonType';

type bannerViewProps = containerProps & imageProps & titleLabelProps & subTitleLabelProps & btnPrimaryProps & btnSecondaryProps

const IterableBannerView = (props: bannerViewProps) => {

const imgURI = props?.imgSrc ? props.imgSrc : 'https://codesymphony.in/assets/projects/noobstrom/noob-web-4.png';
const bannerBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 20,
borderRadius: bannerBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ paddingHorizontal: 10 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 10 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Banner View Title'}
</Text>
<View style={{ height: 50, width: 50 }}>
<Image source={{ uri: imgURI }} style={{ height: props?.imgHeight ? props?.imgHeight : '100%', width: props?.imgWidth ? props?.imgWidth : '100%' }} />
</View>
</View>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null}
style={{ height: 35, paddingHorizontal: 10, borderRadius: 25, justifyContent: 'center', alignItems: 'center', backgroundColor: props?.btnPrimaryBgColor ? props?.btnPrimaryBgColor : '#6A266D'}}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'white',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues:

1. High total complexity (count = 56) [qlty:file-complexity]


2. Found 76 lines of identical code in 2 locations (mass = 582) [qlty:identical-code]

Comment on lines +20 to +73
const IterableBannerView = (props: bannerViewProps) => {

const imgURI = props?.imgSrc ? props.imgSrc : 'https://codesymphony.in/assets/projects/noobstrom/noob-web-4.png';
const bannerBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 20,
borderRadius: bannerBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ paddingHorizontal: 10 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 10 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Banner View Title'}
</Text>
<View style={{ height: 50, width: 50 }}>
<Image source={{ uri: imgURI }} style={{ height: props?.imgHeight ? props?.imgHeight : '100%', width: props?.imgWidth ? props?.imgWidth : '100%' }} />
</View>
</View>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null}
style={{ height: 35, paddingHorizontal: 10, borderRadius: 25, justifyContent: 'center', alignItems: 'center', backgroundColor: props?.btnPrimaryBgColor ? props?.btnPrimaryBgColor : '#6A266D'}}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'white',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 56): IterableBannerView [qlty:function-complexity]

Comment on lines +21 to +71
const IterableCardView = (props: cardViewProps) => {

const imgURI = props?.imgSrc ? props.imgSrc : 'https://codesymphony.in/assets/projects/noobstrom/noob-web-4.png';
const cardBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 10,
borderRadius: cardBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ height: 150, width: '100%' }}>
<Image source={{ uri: imgURI }} style={{ height: props?.imgHeight ? props?.imgHeight : '100%', width: props?.imgWidth ? props?.imgWidth : '100%' }} />
</View>
<View style={{ marginLeft: 20 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Card View Title'}
</Text>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center' }}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues:

1. Function with high complexity (count = 54): IterableCardView [qlty:function-complexity]


2. Found 52 lines of identical code in 2 locations (mass = 485) [qlty:identical-code]

Comment on lines +1 to +67
// @ts-nocheck
import React from 'react'
import {
View,
Text,
TouchableOpacity
} from 'react-native'
import {
containerProps,
imageProps,
titleLabelProps,
subTitleLabelProps,
btnPrimaryProps,
btnSecondaryProps
} from '../types/commonType';

type notificationViewProps = containerProps & imageProps & titleLabelProps & subTitleLabelProps & btnPrimaryProps & btnSecondaryProps

const IterableNotificationView = (props: notificationViewProps) => {
const notificationBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 20,
borderRadius: notificationBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Notification View Title'}
</Text>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null}
style={{ height: 35, paddingHorizontal: 10, borderRadius: 25, justifyContent: 'center', alignItems: 'center', backgroundColor: props?.btnPrimaryBgColor ? props?.btnPrimaryBgColor : '#6A266D' }}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'white',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 68 lines of identical code in 2 locations (mass = 489) [qlty:identical-code]

Comment on lines +19 to +65
const IterableNotificationView = (props: notificationViewProps) => {
const notificationBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 20,
borderRadius: notificationBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Notification View Title'}
</Text>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null}
style={{ height: 35, paddingHorizontal: 10, borderRadius: 25, justifyContent: 'center', alignItems: 'center', backgroundColor: props?.btnPrimaryBgColor ? props?.btnPrimaryBgColor : '#6A266D' }}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'white',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 50): IterableNotificationView [qlty:function-complexity]

Comment on lines +20 to +73
const IterableBannerView = (props: bannerViewProps) => {

const imgURI = props?.imgSrc ? props.imgSrc : 'https://codesymphony.in/assets/projects/noobstrom/noob-web-4.png';
const bannerBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 20,
borderRadius: bannerBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ paddingHorizontal: 10 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 10 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Banner View Title'}
</Text>
<View style={{ height: 50, width: 50 }}>
<Image source={{ uri: imgURI }} style={{ height: props?.imgHeight ? props?.imgHeight : '100%', width: props?.imgWidth ? props?.imgWidth : '100%' }} />
</View>
</View>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null}
style={{ height: 35, paddingHorizontal: 10, borderRadius: 25, justifyContent: 'center', alignItems: 'center', backgroundColor: props?.btnPrimaryBgColor ? props?.btnPrimaryBgColor : '#6A266D'}}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'white',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 56): IterableBannerView [qlty:function-complexity]

Comment on lines +20 to +70
const IterableCardView = (props: cardViewProps) => {

const imgURI = props?.imgSrc ? props.imgSrc : 'https://codesymphony.in/assets/projects/noobstrom/noob-web-4.png';
const cardBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 10,
borderRadius: cardBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ height: 150, width: '100%' }}>
<Image source={{ uri: imgURI }} style={{ height: props?.imgHeight ? props?.imgHeight : '100%', width: props?.imgWidth ? props?.imgWidth : '100%' }} />
</View>
<View style={{ marginLeft: 20 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Card View Title'}
</Text>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center' }}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues:

1. Function with high complexity (count = 54): IterableCardView [qlty:function-complexity]


2. Found 52 lines of identical code in 2 locations (mass = 485) [qlty:identical-code]

Comment on lines +1 to +67
// @ts-nocheck
import React from 'react'
import {
View,
Text,
TouchableOpacity
} from 'react-native'
import {
containerProps,
imageProps,
titleLabelProps,
subTitleLabelProps,
btnPrimaryProps,
btnSecondaryProps
} from '../types/commonType';

type notificationViewProps = containerProps & imageProps & titleLabelProps & subTitleLabelProps & btnPrimaryProps & btnSecondaryProps

const IterableNotificationView = (props: notificationViewProps) => {
const notificationBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 20,
borderRadius: notificationBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Notification View Title'}
</Text>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null}
style={{ height: 35, paddingHorizontal: 10, borderRadius: 25, justifyContent: 'center', alignItems: 'center', backgroundColor: props?.btnPrimaryBgColor ? props?.btnPrimaryBgColor : '#6A266D' }}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'white',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 68 lines of identical code in 2 locations (mass = 489) [qlty:identical-code]

Comment on lines +19 to +65
const IterableNotificationView = (props: notificationViewProps) => {
const notificationBorderRadius = props.borderRadius ? props.borderRadius : 10;

return (
<View style={{
marginBottom: 20,
borderRadius: notificationBorderRadius,
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4',
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000',
shadowOffset: {
width: props?.shadowWidth ? props?.shadowWidth : 0,
height: props?.shadowHeight ? props?.shadowHeight : 1
},
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2,
elevation: 1
}}>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}>
{props?.titleText ? props?.titleText : 'Notification View Title'}
</Text>
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}>
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"}
</Text>
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}>
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null}
style={{ height: 35, paddingHorizontal: 10, borderRadius: 25, justifyContent: 'center', alignItems: 'center', backgroundColor: props?.btnPrimaryBgColor ? props?.btnPrimaryBgColor : '#6A266D' }}>
<Text style={{
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14,
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'white',
fontWeight: 'bold'
}}>
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"}
</Text>
</TouchableOpacity>
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}>
<Text style={{
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14,
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black',
fontWeight: 'bold'
}}>
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"}
</Text>
</TouchableOpacity> : null}
</View>
</View>
</View>
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with high complexity (count = 50): IterableNotificationView [qlty:function-complexity]

Comment on lines +1 to +45
export type containerProps = {
borderRadius?: number,
backgroundColor?: string,
shadowColor?: string,
shadowWidth?: number,
shadowHeight?: number,
shadowOpacity?: number
}

export type imageProps = {
imgHeight?: number,
imgWidth?: number,
imgSrc: string
}

export type titleLabelProps = {
titleText: string,
titleFontSize?: number,
titleTextColor?: string,
}

export type subTitleLabelProps = {
subTitleText: string,
subTitleFontSize?: number,
subTitleTextColor?: string,
}

export type btnPrimaryProps = {
btnPrimaryText: string,
btnPrimaryFontSize?: number,
btnPrimaryTextColor?: string,
btnPrimaryBorderRadius?: number,
btnPrimaryBgColor?: string,
btnPrimaryOnClick?: Function
}

export type btnSecondaryProps = {
btnSecondaryText: string,
btnSecondaryFontSize?: number,
btnSecondaryTextColor?: string,
btnSecondaryBorderRadius?: number,
btnSecondaryBgColor?: string,
isShowbtnSecondary?: boolean,
btnSecondaryOnClick?: Function
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 46 lines of similar code in 2 locations (mass = 137) [qlty:similar-code]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants