znamenica/dneslov

View on GitHub

Showing 2,171 of 2,171 total issues

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

   static getMemo(props) {
      let titles = props.memoes.sort((x, y) => {
         return x.calendary_slug == props.defaultCalendarySlug ? -1 : 0
      })

Severity: Major
Found in app/components/Picture.jsx and 1 other location - About 1 hr to fix
app/components/Eventee.jsx on lines 100..106

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

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

   getErrorText(value_in, context_in = {}) {
      let context = merge(this.props.validation_context || {}, context_in),
          errors = [],
          value = value_in || ''

Severity: Minor
Found in app/components/Validation.jsx - About 1 hr to fix

    Function onSuccessLoad has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

       onSuccessLoad(response) {
          let new_records, new_page, new_state, records = response.data
    
          console.log("[onSuccessLoad] > response", response)
          console.log("[onSuccessLoad] > records", records)
    Severity: Minor
    Found in app/components/Records.jsx - About 1 hr to fix

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

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

        Method validate_each has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

           def validate_each(record, attribute, value)
              options.each do |(type, sub_options)|
                 value_in =
                    case type
                    when :width, :height
        Severity: Minor
        Found in app/validators/size_validator.rb - About 1 hr to fix

          Method load has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

             def load
                unassigned = Resource.unassigned.image
                objects =
                   unassigned.map do |r|
                      info = Memory.find_by(short_name: r[:props]['short_name'])
          Severity: Minor
          Found in app/services/image_sync_service.rb - About 1 hr to fix

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

                           validations: {
                              'Вид связки из списка должен быть выбран': matchEmptyObject,
                              'Вид связки не должен иметь значение "Не связанное" в случае, если связаное имя задано': (value, context) => {
                                 return context.bond_to_id && value == "несвязаное"
                              },
            Severity: Major
            Found in app/components/nameMeta.jsx and 1 other location - About 1 hr to fix
            app/components/memoMeta.jsx on lines 132..140

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

            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_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
            Severity: Major
            Found in app/models/concerns/with_descriptions.rb and 1 other location - About 1 hr to fix
            app/models/concerns/with_links.rb on lines 8..46

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

            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

                     validations: {
                        'Пункт из списка должен быть выбран': matchEmptyObject,
                        'Вид привязки не должен иметь значение "Не привязаный" в случае, если привязка задана': (value, context) => {
                           return context.bond_to_id && value == "несвязаный"
                        },
            Severity: Major
            Found in app/components/memoMeta.jsx and 1 other location - About 1 hr to fix
            app/components/nameMeta.jsx on lines 128..136

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

            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_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: Major
            Found in app/models/concerns/with_links.rb and 1 other location - About 1 hr to fix
            app/models/concerns/with_descriptions.rb on lines 12..51

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

            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 render has 36 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/MemorySpans.jsx - About 1 hr to fix

              Method fix_links_for_calendary has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def fix_links_for_calendary string, slug
                       cal = Calendary.by_slug(slug).first
              
                       Link.transaction do
                          Link.where("url ~* ?", string).where(info_type: "Memory").map do |x|
              Severity: Minor
              Found in app/lib/tasks.rb - About 1 hr to fix

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

                   constructor(props) {
                      super(props)
                
                      this.onAvatarClick = this.onAvatarClick.bind(this)
                      this.onSpanHeaderClick = this.onSpanHeaderClick.bind(this)
                Severity: Major
                Found in app/components/MemorySpan.jsx and 1 other location - About 1 hr to fix
                app/components/Records.jsx on lines 47..52

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

                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

                   constructor(props) {
                      super(props)
                
                      this.onRecordUpdate = this.onRecordUpdate.bind(this)
                      this.onModalClose = this.onModalClose.bind(this)
                Severity: Major
                Found in app/components/Records.jsx and 1 other location - About 1 hr to fix
                app/components/MemorySpan.jsx on lines 29..34

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

                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

                Consider simplifying this complex logical expression.
                Open

                      if (!this.triggered || humanized_value &&
                          (!humanized_value.includes(this.triggered) &&
                           !this.triggered.includes(humanized_value) ||
                           this.data && (this.data.total > Object.keys(this.data.list).length &&
                            humanized_value.includes(this.triggered) ||
                Severity: Critical
                Found in app/components/DynamicField.jsx - About 1 hr to fix

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

                     render() {
                        console.log("[render] > props:", this.props, "state:", this.state)
                  
                        return (
                           <li
                  Severity: Minor
                  Found in app/components/MemorySpan.jsx - About 1 hr to fix

                    Method validate_each has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                       def validate_each(record, attribute, value)
                          o = plain_options
                          code = record.alphabeth_code.to_s.to_sym
                          res = Languageble::MATCH_TABLE[ code ]
                          if res
                    Severity: Minor
                    Found in app/validators/alphabeth_validator.rb - About 1 hr to fix

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

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

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

                                          <label
                                             id='neojulian'
                                             className={this.labelClassName('neojulian')}
                                             key="labelNeojulian"
                                             onClick={this.onClick.bind(this)}
                        Severity: Major
                        Found in app/components/PickMeUpCalendar.jsx and 1 other location - About 1 hr to fix
                        app/components/PickMeUpCalendar.jsx on lines 349..355

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

                        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

                                          <label
                                             id='julian'
                                             className={this.labelClassName('julian')}
                                             key="labelJulian"
                                             onClick={this.onClick.bind(this)}
                        Severity: Major
                        Found in app/components/PickMeUpCalendar.jsx and 1 other location - About 1 hr to fix
                        app/components/PickMeUpCalendar.jsx on lines 356..362

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

                        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