znamenica/dneslov

View on GitHub

Showing 2,171 of 2,171 total issues

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

            {this.props.url &&
               <a
                  href={this.properUrl()}
                  target='_blank' >
                  {this.props.text}</a>}
Severity: Major
Found in app/components/Chip.jsx and 1 other location - About 1 hr to fix
app/components/Name.jsx on lines 169..173

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

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

            {this.props.url &&
               <a
                  href={this.properUrl()}
                  target='_self' >
                  {this.state.autoName}</a>}
Severity: Major
Found in app/components/Name.jsx and 1 other location - About 1 hr to fix
app/components/Chip.jsx on lines 114..118

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

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 matchBound has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

   matchBound(date, forward, backward, strictDay, strictMonth, weekDayIn, weekDay, easter, year, baseDateRef) {
      let cond = false,
          condDate,
          baseDate = baseDateRef["date"],
          condString = `${weekDayIn && "+weekDayIn == weekDay" || "true"} && date ${baseDate && "<=" || ">="} condDate`
Severity: Minor
Found in app/components/PickMeUpCalendar.jsx - About 1 hr to fix

    Function getUrlsFrom has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function getUrlsFrom(calendarySlug, memorySlug, eventeeId) {
       console.debug("[getUrlsFrom] <<<", calendarySlug, memorySlug, eventeeId)
       console.debug("[getUrlsFrom] **", Object.fromEntries(new URLSearchParams(window.location.search)))
       let path = "/" + [calendarySlug, memorySlug, eventeeId].compact().join("/"),
           json_path = (path === '/' && 'index' || path) + '.json',
    Severity: Minor
    Found in app/components/support.jsx - About 1 hr to fix

      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

      Block has too many lines. [33/25]
      Open

         scope :with_memory_names, -> context do
            language_codes = [ context[:locales] ].flatten
            selector = self.select_values.dup
            if self.select_values.dup.empty?
               selector << 'memories.*'
      Severity: Minor
      Found in app/models/memory.rb by rubocop

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

            if (this.props.data && this.props.data['length']) {
               this.counter = CharacterCounter.init(this.$input)
            }
      Severity: Minor
      Found in app/components/TextArea.jsx and 1 other location - About 55 mins to fix
      app/components/TextField.jsx on lines 37..39

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

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

            if (this.props.data && this.props.data['length']) {
               this.counter = CharacterCounter.init(this.$input)
            }
      Severity: Minor
      Found in app/components/TextField.jsx and 1 other location - About 55 mins to fix
      app/components/TextArea.jsx on lines 38..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 54.

      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 getUrlsFrom has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export function getUrlsFrom(calendarySlug, memorySlug, eventeeId) {
         console.debug("[getUrlsFrom] <<<", calendarySlug, memorySlug, eventeeId)
         console.debug("[getUrlsFrom] **", Object.fromEntries(new URLSearchParams(window.location.search)))
         let path = "/" + [calendarySlug, memorySlug, eventeeId].compact().join("/"),
             json_path = (path === '/' && 'index' || path) + '.json',
      Severity: Minor
      Found in app/components/support.jsx - About 55 mins 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

      Block has too many lines. [32/25]
      Open

         scope :with_nomina, -> context do
            join_name = table.table_alias || table.name
            language_codes = [context[:locales]].flatten
            alphabeth_codes = Languageble.alphabeth_list_for(language_codes).flatten
            selector = self.select_values.dup
      Severity: Minor
      Found in app/models/name.rb by rubocop

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

      Object.defineProperty(Object.prototype, 'merge', {
         value: function (other) {
            return Object.assign({}, this, other || {})
         },
         writable: true,
      Severity: Minor
      Found in app/assets/javascripts/ext.js and 1 other location - About 55 mins to fix
      app/assets/javascripts/ext.js on lines 204..209

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

      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

      Object.defineProperty(Object.prototype, '|', {
         value: function (other) {
            return Object.assign({}, this, other || {})
         },
         writable: true,
      Severity: Minor
      Found in app/assets/javascripts/ext.js and 1 other location - About 55 mins to fix
      app/assets/javascripts/ext.js on lines 211..216

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

      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

      Object.defineProperty(Object.prototype, 'isPresent', {
         value: function (func) {
            return Object.keys(this).length > 0
         },
         writable: true,
      Severity: Minor
      Found in app/assets/javascripts/ext.js and 1 other location - About 55 mins to fix
      app/assets/javascripts/ext.js on lines 140..145

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

      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

      Object.defineProperty(Object.prototype, 'isBlank', {
         value: function (func) {
            return Object.keys(this).length == 0
         },
         writable: true,
      Severity: Minor
      Found in app/assets/javascripts/ext.js and 1 other location - About 55 mins to fix
      app/assets/javascripts/ext.js on lines 147..152

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

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

         @flow('componentWillUnmountBefore')
         componentWillUnmount() {
            if (this.counter) {
               this.counter.destroy()
               this.counter = null
      Severity: Minor
      Found in app/components/TextArea.jsx and 1 other location - About 50 mins to fix
      app/components/TextField.jsx on lines 42..48

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

      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

         scope :with_value, -> context do
            language_codes = [ context[:locales] ].flatten
            alphabeth_codes = Languageble.alphabeth_list_for( language_codes ).flatten
            selector = self.select_values.dup
      
      
      Severity: Minor
      Found in app/models/item.rb and 1 other location - About 50 mins to fix
      app/models/order.rb on lines 46..72

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

      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

         scope :by_token, -> text do
            left_outer_joins( :slug, :descriptions, :titles ).
               where( "unaccent(calendaries.author_name) ~* unaccent(?)", "\\m#{text}.*" ).or(
               where( "unaccent(calendaries.council) ~* unaccent(?)", "\\m#{text}.*" ).or(
               where( "slugs.text ~* ?", "\\m#{text}.*" ).or(
      Severity: Minor
      Found in app/models/calendary.rb and 1 other location - About 50 mins to fix
      app/models/memo.rb on lines 139..146

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

      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

         scope :with_value, -> context do
            language_codes = [ context[:locales] ].flatten
            alphabeth_codes = Languageble.alphabeth_list_for( language_codes ).flatten
            selector = self.select_values.dup
      
      
      Severity: Minor
      Found in app/models/order.rb and 1 other location - About 50 mins to fix
      app/models/item.rb on lines 20..45

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

      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