znamenica/dneslov

View on GitHub
app/components/scriptumMeta.jsx

Summary

Maintainability
C
1 day
Test Coverage

File scriptumMeta.jsx has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { matchLanguages, matchAlphabeths, matchLetters, matchEmptyObject, matchCodes, matchEmptyCollection } from 'matchers'

export const scriptumMeta = {
   default: "text", //TODO (value) => { return value.text || value.ref_title || value.title },
   remoteNames: 'scripta',
Severity: Minor
Found in app/components/scriptumMeta.jsx - About 2 hrs to fix

    Function value has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

             value: (value) => {
                const scriptumTable = {
                   'Prolog': 'Пролог',
                   'Irmos': 'Ирмос',
                   'Ikos': 'Икос',
    Severity: Minor
    Found in app/components/scriptumMeta.jsx - About 1 hr to fix

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

                  } else if (value.text && value.text.length > 30) {
                     return value.text.slice(0, 30) + '...'
                  } else {
                     return value.text
                  }
      Severity: Major
      Found in app/components/scriptumMeta.jsx and 1 other location - About 1 hr to fix
      app/components/memoMeta.jsx on lines 36..40

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

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

                  memo_id: {
                     kind: 'dynamic',
                     title: 'Память',
                     humanized_name: 'memo_name',
                     display_scheme: '12-6-9-9',
      Severity: Major
      Found in app/components/scriptumMeta.jsx and 3 other locations - About 1 hr to fix
      app/components/memoryMeta.jsx on lines 118..130
      app/components/memoryMeta.jsx on lines 164..176
      app/components/memoryMeta.jsx on lines 390..402

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

      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

            memo: {
               title: 'Память',
               value: (value) => { return value.memo_scripta && value.memo_scripta[0] && value.memo_scripta[0].memo_name },
            },
      Severity: Major
      Found in app/components/scriptumMeta.jsx and 1 other location - About 1 hr to fix
      app/components/memoMeta.jsx on lines 18..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 57.

      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

            title: {
               kind: 'text',
               title: 'Написание заголовка',
               visible_if: { type: [
                  "Irmos", "Troparion", "Stichira", "Kontakion", "Exapostilarion", "SessionalHymn",
      Severity: Major
      Found in app/components/scriptumMeta.jsx and 2 other locations - About 1 hr to fix
      app/components/scriptumMeta.jsx on lines 208..217
      app/components/scriptumMeta.jsx on lines 218..227

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

      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

            ref_title: {
               kind: 'text',
               title: 'Заголовочная ссылка',
               visible_if: { type: [
                  "Irmos", "Troparion", "Stichira", "Kontakion", "Exapostilarion", "SessionalHymn",
      Severity: Major
      Found in app/components/scriptumMeta.jsx and 2 other locations - About 1 hr to fix
      app/components/scriptumMeta.jsx on lines 198..207
      app/components/scriptumMeta.jsx on lines 208..217

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

      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

            prosomeion_title: {
               kind: 'text',
               title: 'Подобен',
               visible_if: { type: [
                  "Irmos", "Troparion", "Stichira", "Kontakion", "Exapostilarion", "SessionalHymn",
      Severity: Major
      Found in app/components/scriptumMeta.jsx and 2 other locations - About 1 hr to fix
      app/components/scriptumMeta.jsx on lines 198..207
      app/components/scriptumMeta.jsx on lines 218..227

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

      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

      There are no issues that match your filters.

      Category
      Status