Reconmap/web-client

View on GitHub

Showing 450 of 450 total issues

Similar blocks of code found in 23 locations. Consider refactoring.
Open

export const IconDownloadDocument = ({ styling }) => <svg viewBox="0 0 20 20" fill="currentColor" style={styling}
    className={`document-download`}>
    <path fillRule="evenodd"
        d="M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V7.414A2 2 0 0015.414 6L12 2.586A2 2 0 0010.586 2H6zm5 6a1 1 0 10-2 0v3.586l-1.293-1.293a1 1 0 10-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 11.586V8z"
        clipRule="evenodd" />
Severity: Major
Found in src/components/ui/Icons.jsx and 22 other locations - About 2 hrs to fix
src/components/ui/Icons.jsx on lines 21..26
src/components/ui/Icons.jsx on lines 55..60
src/components/ui/Icons.jsx on lines 84..88
src/components/ui/Icons.jsx on lines 101..106
src/components/ui/Icons.jsx on lines 108..113
src/components/ui/Icons.jsx on lines 130..135
src/components/ui/Icons.jsx on lines 137..142
src/components/ui/Icons.jsx on lines 151..155
src/components/ui/Icons.jsx on lines 162..167
src/components/ui/Icons.jsx on lines 169..174
src/components/ui/Icons.jsx on lines 176..179
src/components/ui/Icons.jsx on lines 181..186
src/components/ui/Icons.jsx on lines 194..199
src/components/ui/Icons.jsx on lines 201..206
src/components/ui/Icons.jsx on lines 213..218
src/components/ui/Icons.jsx on lines 220..225
src/components/ui/Icons.jsx on lines 227..232
src/components/ui/Icons.jsx on lines 234..239
src/components/ui/Icons.jsx on lines 241..246
src/components/ui/Icons.jsx on lines 248..253
src/components/ui/Icons.jsx on lines 255..257
src/components/ui/Icons.jsx on lines 265..269

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 83.

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

Further Reading

Similar blocks of code found in 23 locations. Consider refactoring.
Open

export const IconPlus = ({ styling }) => <svg viewBox="0 0 20 20" fill="currentColor" style={styling} className={`plus `}>
    <path fillRule="evenodd" d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z"
        clipRule="evenodd" />
</svg>
Severity: Major
Found in src/components/ui/Icons.jsx and 22 other locations - About 2 hrs to fix
src/components/ui/Icons.jsx on lines 1..6
src/components/ui/Icons.jsx on lines 21..26
src/components/ui/Icons.jsx on lines 55..60
src/components/ui/Icons.jsx on lines 84..88
src/components/ui/Icons.jsx on lines 101..106
src/components/ui/Icons.jsx on lines 108..113
src/components/ui/Icons.jsx on lines 130..135
src/components/ui/Icons.jsx on lines 137..142
src/components/ui/Icons.jsx on lines 151..155
src/components/ui/Icons.jsx on lines 162..167
src/components/ui/Icons.jsx on lines 169..174
src/components/ui/Icons.jsx on lines 181..186
src/components/ui/Icons.jsx on lines 194..199
src/components/ui/Icons.jsx on lines 201..206
src/components/ui/Icons.jsx on lines 213..218
src/components/ui/Icons.jsx on lines 220..225
src/components/ui/Icons.jsx on lines 227..232
src/components/ui/Icons.jsx on lines 234..239
src/components/ui/Icons.jsx on lines 241..246
src/components/ui/Icons.jsx on lines 248..253
src/components/ui/Icons.jsx on lines 255..257
src/components/ui/Icons.jsx on lines 265..269

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 83.

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

Further Reading

Similar blocks of code found in 23 locations. Consider refactoring.
Open

export const IconPlusCircle = ({ styling }) => <svg viewBox="0 0 20 20" fill="currentColor" style={styling}
    className={`plus-circle `}>
    <path fillRule="evenodd"
        d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V7z"
        clipRule="evenodd" />
Severity: Major
Found in src/components/ui/Icons.jsx and 22 other locations - About 2 hrs to fix
src/components/ui/Icons.jsx on lines 1..6
src/components/ui/Icons.jsx on lines 21..26
src/components/ui/Icons.jsx on lines 55..60
src/components/ui/Icons.jsx on lines 84..88
src/components/ui/Icons.jsx on lines 101..106
src/components/ui/Icons.jsx on lines 108..113
src/components/ui/Icons.jsx on lines 130..135
src/components/ui/Icons.jsx on lines 137..142
src/components/ui/Icons.jsx on lines 151..155
src/components/ui/Icons.jsx on lines 162..167
src/components/ui/Icons.jsx on lines 169..174
src/components/ui/Icons.jsx on lines 176..179
src/components/ui/Icons.jsx on lines 194..199
src/components/ui/Icons.jsx on lines 201..206
src/components/ui/Icons.jsx on lines 213..218
src/components/ui/Icons.jsx on lines 220..225
src/components/ui/Icons.jsx on lines 227..232
src/components/ui/Icons.jsx on lines 234..239
src/components/ui/Icons.jsx on lines 241..246
src/components/ui/Icons.jsx on lines 248..253
src/components/ui/Icons.jsx on lines 255..257
src/components/ui/Icons.jsx on lines 265..269

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 83.

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

Further Reading

Similar blocks of code found in 23 locations. Consider refactoring.
Open

export const IconSearch = ({ styling }) => <svg viewBox="0 0 20 20" fill="currentColor" style={styling}
    className={`search `}>
    <path fillRule="evenodd"
        d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
        clipRule="evenodd" />
Severity: Major
Found in src/components/ui/Icons.jsx and 22 other locations - About 2 hrs to fix
src/components/ui/Icons.jsx on lines 1..6
src/components/ui/Icons.jsx on lines 21..26
src/components/ui/Icons.jsx on lines 55..60
src/components/ui/Icons.jsx on lines 84..88
src/components/ui/Icons.jsx on lines 101..106
src/components/ui/Icons.jsx on lines 108..113
src/components/ui/Icons.jsx on lines 130..135
src/components/ui/Icons.jsx on lines 137..142
src/components/ui/Icons.jsx on lines 151..155
src/components/ui/Icons.jsx on lines 162..167
src/components/ui/Icons.jsx on lines 169..174
src/components/ui/Icons.jsx on lines 176..179
src/components/ui/Icons.jsx on lines 181..186
src/components/ui/Icons.jsx on lines 194..199
src/components/ui/Icons.jsx on lines 201..206
src/components/ui/Icons.jsx on lines 220..225
src/components/ui/Icons.jsx on lines 227..232
src/components/ui/Icons.jsx on lines 234..239
src/components/ui/Icons.jsx on lines 241..246
src/components/ui/Icons.jsx on lines 248..253
src/components/ui/Icons.jsx on lines 255..257
src/components/ui/Icons.jsx on lines 265..269

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 83.

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

Further Reading

Similar blocks of code found in 23 locations. Consider refactoring.
Open

export const IconLeft = ({ styling }) => <svg viewBox="0 0 20 20" fill="currentColor" style={styling}
    className={`arrow-left `}>
    <path fillRule="evenodd"
        d="M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z"
        clipRule="evenodd" />
Severity: Major
Found in src/components/ui/Icons.jsx and 22 other locations - About 2 hrs to fix
src/components/ui/Icons.jsx on lines 1..6
src/components/ui/Icons.jsx on lines 55..60
src/components/ui/Icons.jsx on lines 84..88
src/components/ui/Icons.jsx on lines 101..106
src/components/ui/Icons.jsx on lines 108..113
src/components/ui/Icons.jsx on lines 130..135
src/components/ui/Icons.jsx on lines 137..142
src/components/ui/Icons.jsx on lines 151..155
src/components/ui/Icons.jsx on lines 162..167
src/components/ui/Icons.jsx on lines 169..174
src/components/ui/Icons.jsx on lines 176..179
src/components/ui/Icons.jsx on lines 181..186
src/components/ui/Icons.jsx on lines 194..199
src/components/ui/Icons.jsx on lines 201..206
src/components/ui/Icons.jsx on lines 213..218
src/components/ui/Icons.jsx on lines 220..225
src/components/ui/Icons.jsx on lines 227..232
src/components/ui/Icons.jsx on lines 234..239
src/components/ui/Icons.jsx on lines 241..246
src/components/ui/Icons.jsx on lines 248..253
src/components/ui/Icons.jsx on lines 255..257
src/components/ui/Icons.jsx on lines 265..269

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 83.

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

Further Reading

Similar blocks of code found in 23 locations. Consider refactoring.
Open

export const IconExclamationCircle = ({ styling }) => <svg viewBox="0 0 20 20" fill="currentColor" style={styling}
    className={`exclamation-circle `}>
    <path fillRule="evenodd"
        d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z"
        clipRule="evenodd" />
Severity: Major
Found in src/components/ui/Icons.jsx and 22 other locations - About 2 hrs to fix
src/components/ui/Icons.jsx on lines 1..6
src/components/ui/Icons.jsx on lines 21..26
src/components/ui/Icons.jsx on lines 55..60
src/components/ui/Icons.jsx on lines 84..88
src/components/ui/Icons.jsx on lines 101..106
src/components/ui/Icons.jsx on lines 108..113
src/components/ui/Icons.jsx on lines 130..135
src/components/ui/Icons.jsx on lines 151..155
src/components/ui/Icons.jsx on lines 162..167
src/components/ui/Icons.jsx on lines 169..174
src/components/ui/Icons.jsx on lines 176..179
src/components/ui/Icons.jsx on lines 181..186
src/components/ui/Icons.jsx on lines 194..199
src/components/ui/Icons.jsx on lines 201..206
src/components/ui/Icons.jsx on lines 213..218
src/components/ui/Icons.jsx on lines 220..225
src/components/ui/Icons.jsx on lines 227..232
src/components/ui/Icons.jsx on lines 234..239
src/components/ui/Icons.jsx on lines 241..246
src/components/ui/Icons.jsx on lines 248..253
src/components/ui/Icons.jsx on lines 255..257
src/components/ui/Icons.jsx on lines 265..269

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 83.

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

Further Reading

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

const CommandsListPage = () => {
    const navigate = useNavigate();
    const query = useQuery();
    let pageNumber = query.get('page');
    pageNumber = pageNumber !== null ? parseInt(pageNumber) : 1;
Severity: Major
Found in src/components/commands/List.jsx - About 2 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                secureApiFetch(`/commands/${task.command_id}`, {
                    method: "GET",
                })
                    .then((resp) => resp.json())
                    .then((command) => setCommand(command))
Severity: Major
Found in src/components/tasks/Details.jsx and 1 other location - About 2 hrs to fix
src/components/tasks/Details.jsx on lines 107..110

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 82.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            secureApiFetch(`/projects/${task.project_id}`, { method: "GET" })
                .then((resp) => resp.json())
                .then((project) => setProject(project))
                .catch((err) => console.error(err));
Severity: Major
Found in src/components/tasks/Details.jsx and 1 other location - About 2 hrs to fix
src/components/tasks/Details.jsx on lines 99..104

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 82.

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

Further Reading

File Instructions.jsx has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
    Button,
    FormControl,
    FormErrorMessage,
    FormHelperText,
Severity: Minor
Found in src/components/commands/Instructions.jsx - About 2 hrs to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        await secureApiFetch(`/notes`, {
            method: "POST",
            body: JSON.stringify(newNote),
        })
            .then(() => {
Severity: Major
Found in src/components/notes/ModalDialog.jsx and 1 other location - About 2 hrs to fix
src/components/vulnerabilities/categories/AddModalDialog.jsx on lines 18..27

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 81.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        secureApiFetch(`/vulnerabilities/categories`, {
            method: 'POST',
            body: JSON.stringify(newCategory)
        }).then(() => {
            onClose();
Severity: Major
Found in src/components/vulnerabilities/categories/AddModalDialog.jsx and 1 other location - About 2 hrs to fix
src/components/notes/ModalDialog.jsx on lines 27..37

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 81.

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

Further Reading

Identical blocks of code found in 6 locations. Consider refactoring.
Open

        Object.keys(tableModel.filters).forEach(
            (key) =>
                tableModel.filters[key] !== null &&
                tableModel.filters[key].length !== 0 &&
                queryParams.append(key, tableModel.filters[key]),
Severity: Major
Found in src/components/tasks/List.jsx and 5 other locations - About 2 hrs to fix
src/components/projects/Tasks.jsx on lines 25..26
src/components/projects/Vulnerabilities.jsx on lines 22..23
src/components/target/View.jsx on lines 32..33
src/components/vulnerabilities/List.jsx on lines 38..43
src/components/vulnerabilities/List.jsx on lines 59..64

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 80.

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

Further Reading

Identical blocks of code found in 6 locations. Consider refactoring.
Open

        Object.keys(tableModel.filters).forEach(
            (key) =>
                tableModel.filters[key] !== null &&
                tableModel.filters[key].length !== 0 &&
                queryParams.append(key, tableModel.filters[key]),
Severity: Major
Found in src/components/vulnerabilities/List.jsx and 5 other locations - About 2 hrs to fix
src/components/projects/Tasks.jsx on lines 25..26
src/components/projects/Vulnerabilities.jsx on lines 22..23
src/components/target/View.jsx on lines 32..33
src/components/tasks/List.jsx on lines 37..42
src/components/vulnerabilities/List.jsx on lines 38..43

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 80.

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

Further Reading

Identical blocks of code found in 6 locations. Consider refactoring.
Open

        Object.keys(tableModel.filters)
            .forEach(key => tableModel.filters[key] !== null && tableModel.filters[key].length !== 0 && queryParams.append(key, tableModel.filters[key]));
Severity: Major
Found in src/components/projects/Tasks.jsx and 5 other locations - About 2 hrs to fix
src/components/projects/Vulnerabilities.jsx on lines 22..23
src/components/target/View.jsx on lines 32..33
src/components/tasks/List.jsx on lines 37..42
src/components/vulnerabilities/List.jsx on lines 38..43
src/components/vulnerabilities/List.jsx on lines 59..64

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 80.

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

Further Reading

Identical blocks of code found in 6 locations. Consider refactoring.
Open

        Object.keys(tableModel.filters)
            .forEach(key => tableModel.filters[key] !== null && tableModel.filters[key].length !== 0 && queryParams.append(key, tableModel.filters[key]));
Severity: Major
Found in src/components/target/View.jsx and 5 other locations - About 2 hrs to fix
src/components/projects/Tasks.jsx on lines 25..26
src/components/projects/Vulnerabilities.jsx on lines 22..23
src/components/tasks/List.jsx on lines 37..42
src/components/vulnerabilities/List.jsx on lines 38..43
src/components/vulnerabilities/List.jsx on lines 59..64

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 80.

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

Further Reading

Identical blocks of code found in 6 locations. Consider refactoring.
Open

        Object.keys(tableModel.filters)
            .forEach(key => tableModel.filters[key] !== null && tableModel.filters[key].length !== 0 && queryParams.append(key, tableModel.filters[key]));
Severity: Major
Found in src/components/projects/Vulnerabilities.jsx and 5 other locations - About 2 hrs to fix
src/components/projects/Tasks.jsx on lines 25..26
src/components/target/View.jsx on lines 32..33
src/components/tasks/List.jsx on lines 37..42
src/components/vulnerabilities/List.jsx on lines 38..43
src/components/vulnerabilities/List.jsx on lines 59..64

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 80.

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

Further Reading

Identical blocks of code found in 6 locations. Consider refactoring.
Open

        Object.keys(tableModel.filters).forEach(
            (key) =>
                tableModel.filters[key] !== null &&
                tableModel.filters[key].length !== 0 &&
                queryParams.append(key, tableModel.filters[key]),
Severity: Major
Found in src/components/vulnerabilities/List.jsx and 5 other locations - About 2 hrs to fix
src/components/projects/Tasks.jsx on lines 25..26
src/components/projects/Vulnerabilities.jsx on lines 22..23
src/components/target/View.jsx on lines 32..33
src/components/tasks/List.jsx on lines 37..42
src/components/vulnerabilities/List.jsx on lines 59..64

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 80.

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

Further Reading

File Form.jsx has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Breadcrumb, Button } from "@chakra-ui/react";
import AttachmentsImageDropzone from "components/attachments/ImageDropzone";
import NativeInput from "components/form/NativeInput";
import RestrictedComponent from "components/logic/RestrictedComponent";
import PrimaryButton from "components/ui/buttons/Primary";
Severity: Minor
Found in src/components/settings/Organisation/Form.jsx - About 2 hrs to fix

Function DashboardPanels has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DashboardPanels = () => {
    const { user } = useAuth();
    user.preferences = initialiseUserPreferences(user);
    const [dashboardConfig, setDashboardConfig] = useState(user?.preferences?.['web-client.widgets'] || InitialiseWidgetConfig());
    const [visibleWidgets, setVisibleWidgets] = useState(filterWidgets(user));
Severity: Major
Found in src/components/layout/dashboard/DashboardPanels.jsx - About 2 hrs to fix
Severity
Category
Status
Source
Language