ricarthlima/eo-project-es

View on GitHub

Showing 129 of 135 total issues

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

      _proto._getPopperConfig = function _getPopperConfig() {
        var _this2 = this;

        var offsetConf = {};

Severity: Minor
Found in app/assets/javascripts/application.js - About 1 hr to fix

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

          _proto._setListeners = function _setListeners() {
            var _this3 = this;
    
            var triggers = this.config.trigger.split(' ');
            triggers.forEach(function (trigger) {
    Severity: Minor
    Found in app/assets/javascripts/application.js - About 1 hr to fix

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

        def show
          # Adicionar no histórico de pesquisa
          if usuario_signed_in?
            consulta = UsuarioBuscaComponente.where("usuario_id = " + current_usuario.id.to_s + " AND " + "componente_id = " + @componente.id.to_s)
            if consulta.size > 0
      Severity: Major
      Found in app/controllers/componentes_controller.rb and 1 other location - About 1 hr to fix
      app/controllers/marcas_controller.rb on lines 13..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 51.

      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

        def show
          # Adicionar no histórico de pesquisa
          if usuario_signed_in?
            consulta = UsuarioBuscaMarca.where("usuario_id = " + current_usuario.id.to_s + " AND " + "marca_id = " + @marca.id.to_s)
            if consulta.size > 0
      Severity: Major
      Found in app/controllers/marcas_controller.rb and 1 other location - About 1 hr to fix
      app/controllers/componentes_controller.rb on lines 16..24

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

      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

          var Event = {
            SHOW: "show" + EVENT_KEY,
            SHOWN: "shown" + EVENT_KEY,
            HIDE: "hide" + EVENT_KEY,
            HIDDEN: "hidden" + EVENT_KEY,
      Severity: Major
      Found in app/assets/javascripts/application.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/application.js on lines 3696..3702

      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

          var Event = {
            HIDE: "hide" + EVENT_KEY,
            HIDDEN: "hidden" + EVENT_KEY,
            SHOW: "show" + EVENT_KEY,
            SHOWN: "shown" + EVENT_KEY,
      Severity: Major
      Found in app/assets/javascripts/application.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/application.js on lines 1094..1100

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

        def create
          authorize! :menage, :all
          @componente = Componente.new(componente_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/componentes_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @usuario_busca_marca = UsuarioBuscaMarca.new(usuario_busca_marca_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/usuario_busca_marcas_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @usuario_avalia_produto = UsuarioAvaliaProduto.new(usuario_avalia_produto_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/usuario_avalia_produtos_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @usuario_busca_componente = UsuarioBuscaComponente.new(usuario_busca_componente_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/usuario_busca_componentes_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @marca_nome_alternativo = MarcaNomeAlternativo.new(marca_nome_alternativo_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/marca_nome_alternativos_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @usuario_avalia_marca = UsuarioAvaliaMarca.new(usuario_avalia_marca_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/usuario_avalia_marcas_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @usuario_busca_produto = UsuarioBuscaProduto.new(usuario_busca_produto_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/usuario_busca_produtos_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @componente_nome_alternativo = ComponenteNomeAlternativo.new(componente_nome_alternativo_params)
      
          respond_to do |format|
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @produto_possui_componente = ProdutoPossuiComponente.new(produto_possui_componente_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/produto_possui_componentes_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @produto_nome_alternativo = ProdutoNomeAlternativo.new(produto_nome_alternativo_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/produto_nome_alternativos_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @marca = Marca.new(marca_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/marcas_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/produtos_controller.rb on lines 50..60
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

        def create
          authorize! :menage, :all
          @produto = Produto.new(produto_params)
      
          respond_to do |format|
      Severity: Major
      Found in app/controllers/produtos_controller.rb and 11 other locations - About 1 hr to fix
      app/controllers/componente_nome_alternativos_controller.rb on lines 31..41
      app/controllers/componentes_controller.rb on lines 42..52
      app/controllers/marca_nome_alternativos_controller.rb on lines 31..41
      app/controllers/marcas_controller.rb on lines 40..50
      app/controllers/produto_nome_alternativos_controller.rb on lines 31..41
      app/controllers/produto_possui_componentes_controller.rb on lines 31..41
      app/controllers/usuario_avalia_marcas_controller.rb on lines 31..41
      app/controllers/usuario_avalia_produtos_controller.rb on lines 31..41
      app/controllers/usuario_busca_componentes_controller.rb on lines 31..41
      app/controllers/usuario_busca_marcas_controller.rb on lines 31..41
      app/controllers/usuario_busca_produtos_controller.rb on lines 31..41

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

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

            _proto._transitionComplete = function _transitionComplete(element, active, callback) {
              if (active) {
                $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
                var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
      
      
      Severity: Minor
      Found in app/assets/javascripts/application.js - About 1 hr to fix

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

                  if (!context) {
                    context = new this.constructor(event.currentTarget, this._getDelegateConfig());
                    $$$1(event.currentTarget).data(dataKey, context);
                  }
        Severity: Major
        Found in app/assets/javascripts/application.js and 2 other locations - About 1 hr to fix
        app/assets/javascripts/application.js on lines 2941..2944
        app/assets/javascripts/application.js on lines 2974..2977

        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

        Severity
        Category
        Status
        Source
        Language