Showing 8,855 of 8,855 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
<ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>
<span style={{ fontWeight: "bold" }}>Timestamp:</span>{" "}
{format(new Date(item.timestamp), "pp PP")}
</ListItem>
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>
<span style={{ fontWeight: "bold" }}>Timestamp:</span>{" "}
{format(new Date(item.timestamp), "pp PP")}
</ListItem>
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
export function registerByEmail(
email: string,
password: string,
firstName: string,
lastName: string
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function ThreadContainer
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
const ThreadContainer: React.FC<ThreadContainerProps> = ({
roomData,
handleSetThreadView,
isThreadView,
profile,
- Read upRead up
- Create a ticketCreate a ticket
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 EditProfileModal
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export default function EditProfileModal({ open, setOpen, user }: TProps) {
const [change, setChange] = useState(false);
const [loading, setLoading] = useState(false);
const setUser = useStoreState((state) => state.setUser);
- Read upRead up
- Create a ticketCreate a ticket
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 RegisterScreen
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const RegisterScreen = ({navigation}: RegisterScreenProps) => {
const [password, setPassword] = useState('');
const [username, setUsername] = useState('');
const [passwordCheck, setPasswordCheck] = useState('');
const [firstname, setFirstname] = useState('');
- Read upRead up
- Create a ticketCreate a ticket
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 handleSendMessage
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleSendMessage = (message: IMessage[]) => {
const messageText = message[0].text;
const tokenAmount = message[0].tokenAmount || 0;
const receiverMessageId = message[0].receiverMessageId || 0;
const data = {
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<View width={'90%'}>
<HStack>
<Text fontFamily={textStyles.semiBoldFont}>Full </Text>
<Text>(default)</Text>
</HStack>
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<View width={'90%'} justifyContent={'flex-end'}>
<HStack>
<Text fontFamily={textStyles.semiBoldFont}>Open </Text>
<Text>(default)</Text>
</HStack>
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function router
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const router = (handlerData) => {
const roomMuteIndex = muteRoomList.indexOf(handlerData.roomJID)
if(roomMuteIndex > -1){
if (messageCheck(handlerData.message, 'start translate') ||
- Create a ticketCreate a ticket
Function router
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const router = (handlerData) => {
handlerData.userStep = userSteps('getStep', handlerData.userJID);
if (messageCheck(handlerData.message, 'close') || messageCheck(handlerData.message, 'leave')) {
return leaveHandler(handlerData);
- Create a ticketCreate a ticket
Function QRSection
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const QRSection = (props: QRSectionProps) => {
const {
user,
createdLink,
linkType
- Create a ticketCreate a ticket
Function setChatAvatar
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setChatAvatar = async (type: string) => {
if (type === 'image') {
launchImageLibrary(options, response => {
if (response.didCancel) {
console.log('User cancelled image picker');
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
!process.env.TYPE ||
!process.env.BOT_ADDRESS ||
!process.env.CONFERENCE_ADDRESS ||
!process.env.APP_USERNAME ||
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
!process.env.TYPE ||
!process.env.BOT_ADDRESS ||
!process.env.CONFERENCE_ADDRESS ||
!process.env.APP_USERNAME ||
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
!process.env.TYPE ||
!process.env.BOT_ADDRESS ||
!process.env.CONFERENCE_ADDRESS ||
!process.env.APP_USERNAME ||
- Create a ticketCreate a ticket
Function Explorer
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Explorer() {
const user = useStoreState((store) => store.user);
const [transactions, setTransactions] = useState<
ExplorerRespose<ITransaction[]>
>({
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
item.tokenType === 'NFMT' &&
item.balances &&
item.contractTokenIds &&
item.maxSupplies &&
- Create a ticketCreate a ticket
Function onSuccess
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onSuccess = (e: any) => {
if (!e) {
showToast('error', 'Error', 'Invalid QR', 'top');
setIsLoading(false);
return;
- Create a ticketCreate a ticket
Function setChatAvatar
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setChatAvatar = async (type: string) => {
if (type === 'image') {
launchImageLibrary(options, response => {
if (response.didCancel) {
console.log('User cancelled image picker');
- Create a ticketCreate a ticket