znamenica/dneslov

View on GitHub

Showing 2,171 of 2,171 total issues

Function dateFor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

   static dateFor(yearDate, msDate, style) {
      console.debug("[dateFor] <<<", yearDate, msDate, style)

      let dateIn = new Date(msDate || Date.now()),
          yearIn = dateIn.getFullYear(),
Severity: Minor
Found in app/components/EventSpans.jsx - About 1 hr to fix

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

       render() {
          console.log("[render] * props", this.props)
    
          return (
             <div className='row'>
    Severity: Minor
    Found in app/components/SearchConditions.jsx - About 1 hr to fix

      Method fix_memo_scripta_for_scripta has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

            def fix_memo_scripta_for_scripta
               Scriptum.transaction do
                  Scriptum.find_each do |s|
                     begin
                        if s.memo_scripta.blank? && s.service_scripta.present?
      Severity: Minor
      Found in app/lib/tasks.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

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

         static getLinks(props) {
            let links = [ "WikiLink", "BeingLink", "PatericLink" ].map((type) => {
               return props.links.selectByKey("type", type)
            }).flat()
      
      
      Severity: Major
      Found in app/components/Eventee.jsx and 1 other location - About 1 hr to fix
      app/components/Picture.jsx on lines 89..95

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

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

         def self.included base
            base.class_eval do
               has_many :titles, -> { title }, as: :describable, class_name: :Title
               has_many :default_titles, -> { distinct }, through: :kind, source: :names, class_name: :Appellation
               has_many :all_titles, ->(this) do
      Severity: Minor
      Found in app/models/concerns/with_titles.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

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

         static getLinks(props) {
            let links = [ "WikiLink", "BeingLink", "PatericLink" ].map((type) => {
               return props.links.selectByKey("type", type)
            }).flat()
      
      
      Severity: Major
      Found in app/components/Picture.jsx and 1 other location - About 1 hr to fix
      app/components/Eventee.jsx on lines 88..94

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

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

               scope :by_tokens, -> string_in do
                  return self if string_in.blank?
                  # TODO fix the correctness of the query
                  klass = self.model_name.name.constantize
                  or_rel_tokens = string_in.split(/\//).map do |or_token|
      Severity: Major
      Found in app/models/concerns/tokens.rb and 6 other locations - About 1 hr to fix
      app/models/calendary.rb on lines 56..68
      app/models/memo.rb on lines 148..163
      app/models/memory.rb on lines 60..75
      app/models/name.rb on lines 23..37
      app/models/order.rb on lines 25..37
      app/models/subject.rb on lines 30..42

      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

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

         scope :by_tokens, -> string_in do
            return self if string_in.blank?
            # TODO fix the correctness of the query
            klass = self.model_name.name.constantize
            or_rel_tokens = string_in.split(/\//).map do |or_token|
      Severity: Major
      Found in app/models/subject.rb and 6 other locations - About 1 hr to fix
      app/models/calendary.rb on lines 56..68
      app/models/concerns/tokens.rb on lines 6..18
      app/models/memo.rb on lines 148..163
      app/models/memory.rb on lines 60..75
      app/models/name.rb on lines 23..37
      app/models/order.rb on lines 25..37

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 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

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

         scope :by_tokens, -> string_in do
            return self if string_in.blank?
            # TODO fix the correctness of the query
            klass = self.model_name.name.constantize
            or_rel_tokens = string_in.split(/\//).map do |or_token|
      Severity: Major
      Found in app/models/memo.rb and 6 other locations - About 1 hr to fix
      app/models/calendary.rb on lines 56..68
      app/models/concerns/tokens.rb on lines 6..18
      app/models/memory.rb on lines 60..75
      app/models/name.rb on lines 23..37
      app/models/order.rb on lines 25..37
      app/models/subject.rb on lines 30..42

      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

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

         scope :by_tokens, -> string_in do
            return self if string_in.blank?
            # TODO fix the correctness of the query
            klass = self.model_name.name.constantize
            or_rel_tokens = string_in.split(/\//).map do |or_token|
      Severity: Major
      Found in app/models/calendary.rb and 6 other locations - About 1 hr to fix
      app/models/concerns/tokens.rb on lines 6..18
      app/models/memo.rb on lines 148..163
      app/models/memory.rb on lines 60..75
      app/models/name.rb on lines 23..37
      app/models/order.rb on lines 25..37
      app/models/subject.rb on lines 30..42

      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

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

         scope :by_tokens, -> string_in do
            return self if string_in.blank?
            # TODO fix the correctness of the query
            klass = self.model_name.name.constantize
            or_rel_tokens = string_in.split(/\//).map do |or_token|
      Severity: Major
      Found in app/models/order.rb and 6 other locations - About 1 hr to fix
      app/models/calendary.rb on lines 56..68
      app/models/concerns/tokens.rb on lines 6..18
      app/models/memo.rb on lines 148..163
      app/models/memory.rb on lines 60..75
      app/models/name.rb on lines 23..37
      app/models/subject.rb on lines 30..42

      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. [36/25]
      Open

               scope :with_descriptions, -> 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

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

         scope :by_tokens, -> string_in do
            return self if string_in.blank?
            # TODO fix the correctness of the query
            klass = self.model_name.name.constantize
            or_rel_tokens = string_in.split(/\//).map do |or_token|
      Severity: Major
      Found in app/models/memory.rb and 6 other locations - About 1 hr to fix
      app/models/calendary.rb on lines 56..68
      app/models/concerns/tokens.rb on lines 6..18
      app/models/memo.rb on lines 148..163
      app/models/name.rb on lines 23..37
      app/models/order.rb on lines 25..37
      app/models/subject.rb on lines 30..42

      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

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

         scope :by_tokens, -> string_in do
            return self if string_in.blank?
            # TODO fix the correctness of the query
            klass = self.model_name.name.constantize
            or_rel_tokens = string_in.split(/\//).map do |or_token|
      Severity: Major
      Found in app/models/name.rb and 6 other locations - About 1 hr to fix
      app/models/calendary.rb on lines 56..68
      app/models/concerns/tokens.rb on lines 6..18
      app/models/memo.rb on lines 148..163
      app/models/memory.rb on lines 60..75
      app/models/order.rb on lines 25..37
      app/models/subject.rb on lines 30..42

      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. [36/25]
      Open

         scope :with_names, -> context do
            language_codes = [ context[:locales] ].flatten
            alphabeth_codes = Languageble.alphabeth_list_for( language_codes ).flatten
            selector = self.select_values.dup
            if self.select_values.dup.empty?
      Severity: Minor
      Found in app/models/subject.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. [36/25]
      Open

         scope :with_icon, -> context do
            as = table.table_alias || table.name
            language_codes = [ context[:locales] ].flatten
            selector = self.select_values.dup
            selector << "#{as}.*" if selector.empty?
      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.

      Method attrs has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

         def attrs
            @attrs ||=
               folders.map do |folder|
                  fbase = File.basename(folder)
                  target_path = File.join(now.strftime("%Y"), now.strftime("%m"), now.strftime("%Y%m%d%H%M%S"))
      Severity: Minor
      Found in app/services/image_sync_service.rb - About 1 hr to fix

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

        export function getPathsFromState(state) {
           console.debug("[getPathsFromState] <<<", state)
           console.debug("[getPathsFromState] **", state.calendarySlug, state.memory?.slug, state.eventee, state.gallery)
           let calendarySlug = state.query.c?.split(",").length == 1 && state.query.c ||
               state.query.c?.split(",")?.length == 0 && state.calendarySlug || null,
        Severity: Minor
        Found in app/components/support.jsx - About 1 hr 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

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

                     scope :with_links, -> 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/concerns/with_links.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.

            Severity
            Category
            Status
            Source
            Language