znamenica/dneslov

View on GitHub

Showing 2,171 of 2,171 total issues

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

   scope :with_markups, -> 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/reading.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.

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

namespace :fix do
   desc "Fix root_id in names"
   task root_id: :environment do
      Tasks.fix_root_in_names

Severity: Minor
Found in lib/tasks/fix.rake 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.

Function render has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

   render() {
      return [
         <div className="fixed-action-btn">
            <Steps
               enabled={this.state.enabled}
Severity: Minor
Found in app/components/Intro.jsx - About 1 hr to fix

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

                {element.value._destroy &&
                   <a
                      onClick={() => { this.onToggleItem(element) }}
                      className="block-item btn-floating btn-small waves-effect waves-light terracota">
                      <i className="small material-icons">settings_backup_restore</i></a> ||
    Severity: Major
    Found in app/components/Collection.jsx and 1 other location - About 1 hr to fix
    app/components/Collection.jsx on lines 99..107

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

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

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

    Function onApplyRange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

       onApplyRange() {
          let r = this.state.pendingRange,
              beginName = this.repathTo(this.props.name, "begin"),
              endName = this.repathTo(this.props.name, "end"),
              valueDetail, ce,
    Severity: Minor
    Found in app/components/DynamicField.jsx - About 1 hr to fix

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

                  bond_to_id: {
                     kind: 'dynamic',
                     title: 'Память',
                     display_scheme: '12-6-9-10',
                     pathname: 'short_memories',
      Severity: Major
      Found in app/components/memoryMeta.jsx and 3 other locations - About 1 hr to fix
      app/components/memoryMeta.jsx on lines 118..130
      app/components/memoryMeta.jsx on lines 390..402
      app/components/scriptumMeta.jsx on lines 257..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 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 4 locations. Consider refactoring.
      Open

                  place_id: {
                     kind: 'dynamic',
                     title: 'Место',
                     display_scheme: '12-9-10-10',
                     pathname: 'short_places',
      Severity: Major
      Found in app/components/memoryMeta.jsx and 3 other locations - About 1 hr to fix
      app/components/memoryMeta.jsx on lines 164..176
      app/components/memoryMeta.jsx on lines 390..402
      app/components/scriptumMeta.jsx on lines 257..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 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

            memory_id: {
               kind: 'dynamic',
               humanized_name: 'memory_name',
               display_scheme: '12-6-4-4',
               pathname: 'short_memories',
      Severity: Major
      Found in app/components/memoMeta.jsx and 1 other location - About 1 hr to fix
      app/components/memoMeta.jsx on lines 52..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 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

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

         static isInCalendaries(props, memo) {
            let selected = props.selectedCalendaries.filter(calendarySlug => {
               return memo.calendary_slug == calendarySlug
            })
      
      
      Severity: Major
      Found in app/components/Eventee.jsx and 1 other location - About 1 hr to fix
      app/components/Picture.jsx on lines 119..125

      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

            calendary_id: {
               kind: 'dynamic',
               title: 'Календарь',
               humanized_name: 'calendary_title',
               pathname: 'short_calendaries',
      Severity: Major
      Found in app/components/memoMeta.jsx and 1 other location - About 1 hr to fix
      app/components/memoMeta.jsx on lines 65..77

      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

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

         static isInCalendaries(props, memo) {
            let selected = props.selectedCalendaries.filter(calendarySlug => {
               return memo.calendary_slug == calendarySlug
            })
      
      
      Severity: Major
      Found in app/components/Picture.jsx and 1 other location - About 1 hr to fix
      app/components/Eventee.jsx on lines 118..124

      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

            order: {
               title: 'Чин',
               value: (value) => { return value.memo_orders && value.memo_orders[0] && value.memo_orders[0].order },
            },
      Severity: Major
      Found in app/components/memoMeta.jsx and 1 other location - About 1 hr to fix
      app/components/scriptumMeta.jsx on lines 71..74

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

                  nomen_id: {
                     kind: 'dynamic',
                     title: 'Имя',
                     humanized_name: 'name',
                     display_scheme: '12-4-3-3',
      Severity: Major
      Found in app/components/memoryMeta.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/scriptumMeta.jsx on lines 257..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 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

      Method year_date_for has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

         def self.year_date_for year_date, date_in, julian
            return nil if date_in.blank?
      
            date =  [ Time, Date, DateTime ].any? {|c| date_in.is_a?(c) } && date_in || Time.parse(date_in)
            if /(?<day>\d+)\.(?<month>\d+)%(?<weekday>\d+)$/ =~ year_date
      Severity: Minor
      Found in app/models/event.rb - About 1 hr 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

      Method set_base_year has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

         def set_base_year
            types = %w(Resurrection Repose Writing Appearance Translation Sanctification)
      
            event = self.events.to_a.sort_by { |x| (types.index(x.kind) || 100) }.first
      
      
      Severity: Minor
      Found in app/models/memory.rb - About 1 hr to fix

        Function renderModal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

           renderModal() {
              return (
                 <div className='enrighten'>
                    <div
                       key='calendary-form-modal'
        Severity: Minor
        Found in app/components/Modal.jsx - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language