cityssm/corporate-records-manager

View on GitHub

Showing 256 of 266 total issues

Function doTask has a Cognitive Complexity of 33 (exceeds 15 allowed). Consider refactoring.
Open

const doTask = async () => {

  debugTask("Starting DocuShare Link Finder Task");

  const recordCache = new Map<string, recordTypes.Record[]>();
Severity: Minor
Found in tasks/docuShareLinkFinder.ts - About 3 hrs 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

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

    }, (responseJSON: { success: boolean; message?: string; statusTypes?: recordTypes.StatusType[] }) => {

      if (responseJSON.success) {
        statusTypes = responseJSON.statusTypes;
        renderStatusTypesFunction();
Severity: Major
Found in public-typescript/admin/statusTypes.ts and 1 other location - About 3 hrs to fix
public-typescript/admin/statusTypes.ts on lines 150..161

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

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

      }, (responseJSON: { success: boolean; message?: string; statusTypes?: recordTypes.StatusType[] }) => {

        if (responseJSON.success) {
          statusTypes = responseJSON.statusTypes;
          renderStatusTypesFunction();
Severity: Major
Found in public-typescript/admin/statusTypes.ts and 1 other location - About 3 hrs to fix
public-typescript/admin/statusTypes.ts on lines 79..90

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

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 3 locations. Consider refactoring.
Open

    const getStatusTypeFromEventFunction = (clickEvent) => {
        const buttonElement = clickEvent.currentTarget;
        const trElement = buttonElement.closest("tr");
        const statusTypeIndex = Number.parseInt(trElement.dataset.index, 10);
        const statusType = statusTypes[statusTypeIndex];
Severity: Major
Found in public-typescript/admin/statusTypes.js and 2 other locations - About 3 hrs to fix
public-typescript/admin/recordUserTypes.js on lines 8..19
public-typescript/admin/users.js on lines 8..19

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

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 5 locations. Consider refactoring.
Open

    const renderStatusesFunction = () => {
        crmEdit.clearPanelBlocksFunction(statusPanelElement);
        if (statuses.length === 0) {
            statusPanelElement.insertAdjacentHTML("beforeend", "<div class=\"panel-block is-block\">" +
                "<div class=\"message is-warning\">" +
Severity: Major
Found in public-typescript/edit/recordStatuses.js and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordComments.js on lines 92..105
public-typescript/edit/recordURLs.js on lines 93..106
public-typescript/edit/recordUsers.js on lines 57..70
public-typescript/edit/relatedRecords.js on lines 42..55

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

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 5 locations. Consider refactoring.
Open

    const renderRecordUsersFunction = () => {
        crmEdit.clearPanelBlocksFunction(userPanelElement);
        if (recordUsers.length === 0) {
            userPanelElement.insertAdjacentHTML("beforeend", "<div class=\"panel-block is-block\">" +
                "<div class=\"message is-info\">" +
Severity: Major
Found in public-typescript/edit/recordUsers.js and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordComments.js on lines 92..105
public-typescript/edit/recordStatuses.js on lines 119..132
public-typescript/edit/recordURLs.js on lines 93..106
public-typescript/edit/relatedRecords.js on lines 42..55

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

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 3 locations. Consider refactoring.
Open

    const getRecordUserTypeFromEventFunction = (clickEvent) => {
        const buttonElement = clickEvent.currentTarget;
        const trElement = buttonElement.closest("tr");
        const recordUserTypeIndex = Number.parseInt(trElement.dataset.index, 10);
        const recordUserType = recordUserTypes[recordUserTypeIndex];
Severity: Major
Found in public-typescript/admin/recordUserTypes.js and 2 other locations - About 3 hrs to fix
public-typescript/admin/statusTypes.js on lines 9..20
public-typescript/admin/users.js on lines 8..19

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

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 5 locations. Consider refactoring.
Open

export const handler: RequestHandler = async (request, response) => {

  const recordID = request.body.recordID;

  const recordUsers = await getRecordUsers(recordID);
Severity: Major
Found in handlers/view/doGetRecordUsers.ts and 4 other locations - About 3 hrs to fix
handlers/view/doGetComments.ts on lines 6..21
handlers/view/doGetRelatedRecords.ts on lines 6..21
handlers/view/doGetStatuses.ts on lines 6..21
handlers/view/doGetURLs.ts on lines 6..21

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

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 5 locations. Consider refactoring.
Open

  const renderCommentsFunction = () => {

    crmEdit.clearPanelBlocksFunction(commentPanelElement);

    if (comments.length === 0) {
Severity: Major
Found in public-typescript/edit/recordComments.ts and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordStatuses.ts on lines 183..200
public-typescript/edit/recordURLs.ts on lines 143..160
public-typescript/edit/recordUsers.ts on lines 94..111
public-typescript/edit/relatedRecords.ts on lines 79..97

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

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 5 locations. Consider refactoring.
Open

export const handler: RequestHandler = async (request, response) => {

  const recordID = request.body.recordID;

  const statuses = await getRecordStatuses(recordID);
Severity: Major
Found in handlers/view/doGetStatuses.ts and 4 other locations - About 3 hrs to fix
handlers/view/doGetComments.ts on lines 6..21
handlers/view/doGetRecordUsers.ts on lines 6..21
handlers/view/doGetRelatedRecords.ts on lines 6..21
handlers/view/doGetURLs.ts on lines 6..21

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

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 5 locations. Consider refactoring.
Open

    const renderRelatedRecordsFunction = () => {
        crmEdit.clearPanelBlocksFunction(relatedRecordPanelElement);
        if (relatedRecords.length === 0) {
            relatedRecordPanelElement.insertAdjacentHTML("beforeend", "<div class=\"panel-block is-block\">" +
                "<div class=\"message is-info\">" +
Severity: Major
Found in public-typescript/edit/relatedRecords.js and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordComments.js on lines 92..105
public-typescript/edit/recordStatuses.js on lines 119..132
public-typescript/edit/recordURLs.js on lines 93..106
public-typescript/edit/recordUsers.js on lines 57..70

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

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 3 locations. Consider refactoring.
Open

    const getUserFromEventFunction = (clickEvent) => {
        const buttonElement = clickEvent.currentTarget;
        const trElement = buttonElement.closest("tr");
        const userIndex = Number.parseInt(trElement.dataset.index, 10);
        const user = users[userIndex];
Severity: Major
Found in public-typescript/admin/users.js and 2 other locations - About 3 hrs to fix
public-typescript/admin/recordUserTypes.js on lines 8..19
public-typescript/admin/statusTypes.js on lines 9..20

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

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 5 locations. Consider refactoring.
Open

  const renderURLsFunction = () => {

    crmEdit.clearPanelBlocksFunction(urlPanelElement);

    if (urls.length === 0) {
Severity: Major
Found in public-typescript/edit/recordURLs.ts and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordComments.ts on lines 145..162
public-typescript/edit/recordStatuses.ts on lines 183..200
public-typescript/edit/recordUsers.ts on lines 94..111
public-typescript/edit/relatedRecords.ts on lines 79..97

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

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 5 locations. Consider refactoring.
Open

    const renderCommentsFunction = () => {
        crmEdit.clearPanelBlocksFunction(commentPanelElement);
        if (comments.length === 0) {
            commentPanelElement.insertAdjacentHTML("beforeend", "<div class=\"panel-block is-block\">" +
                "<div class=\"message is-info\">" +
Severity: Major
Found in public-typescript/edit/recordComments.js and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordStatuses.js on lines 119..132
public-typescript/edit/recordURLs.js on lines 93..106
public-typescript/edit/recordUsers.js on lines 57..70
public-typescript/edit/relatedRecords.js on lines 42..55

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

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 5 locations. Consider refactoring.
Open

    const renderURLsFunction = () => {
        crmEdit.clearPanelBlocksFunction(urlPanelElement);
        if (urls.length === 0) {
            urlPanelElement.insertAdjacentHTML("beforeend", "<div class=\"panel-block is-block\">" +
                "<div class=\"message is-info\">" +
Severity: Major
Found in public-typescript/edit/recordURLs.js and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordComments.js on lines 92..105
public-typescript/edit/recordStatuses.js on lines 119..132
public-typescript/edit/recordUsers.js on lines 57..70
public-typescript/edit/relatedRecords.js on lines 42..55

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

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 5 locations. Consider refactoring.
Open

export const handler: RequestHandler = async (request, response) => {

  const recordID = request.body.recordID;

  const comments = await getRecordComments(recordID);
Severity: Major
Found in handlers/view/doGetComments.ts and 4 other locations - About 3 hrs to fix
handlers/view/doGetRecordUsers.ts on lines 6..21
handlers/view/doGetRelatedRecords.ts on lines 6..21
handlers/view/doGetStatuses.ts on lines 6..21
handlers/view/doGetURLs.ts on lines 6..21

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

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 5 locations. Consider refactoring.
Open

export const handler: RequestHandler = async (request, response) => {

  const recordID = request.body.recordID;

  const urls = await getRecordURLs(recordID);
Severity: Major
Found in handlers/view/doGetURLs.ts and 4 other locations - About 3 hrs to fix
handlers/view/doGetComments.ts on lines 6..21
handlers/view/doGetRecordUsers.ts on lines 6..21
handlers/view/doGetRelatedRecords.ts on lines 6..21
handlers/view/doGetStatuses.ts on lines 6..21

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

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 5 locations. Consider refactoring.
Open

  const renderRelatedRecordsFunction = () => {

    crmEdit.clearPanelBlocksFunction(relatedRecordPanelElement);

    if (relatedRecords.length === 0) {
Severity: Major
Found in public-typescript/edit/relatedRecords.ts and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordComments.ts on lines 145..162
public-typescript/edit/recordStatuses.ts on lines 183..200
public-typescript/edit/recordURLs.ts on lines 143..160
public-typescript/edit/recordUsers.ts on lines 94..111

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

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 5 locations. Consider refactoring.
Open

  const renderRecordUsersFunction = () => {

    crmEdit.clearPanelBlocksFunction(userPanelElement);

    if (recordUsers.length === 0) {
Severity: Major
Found in public-typescript/edit/recordUsers.ts and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordComments.ts on lines 145..162
public-typescript/edit/recordStatuses.ts on lines 183..200
public-typescript/edit/recordURLs.ts on lines 143..160
public-typescript/edit/relatedRecords.ts on lines 79..97

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

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 5 locations. Consider refactoring.
Open

  const renderStatusesFunction = () => {

    crmEdit.clearPanelBlocksFunction(statusPanelElement);

    if (statuses.length === 0) {
Severity: Major
Found in public-typescript/edit/recordStatuses.ts and 4 other locations - About 3 hrs to fix
public-typescript/edit/recordComments.ts on lines 145..162
public-typescript/edit/recordURLs.ts on lines 143..160
public-typescript/edit/recordUsers.ts on lines 94..111
public-typescript/edit/relatedRecords.ts on lines 79..97

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

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

Severity
Category
Status
Source
Language