Noosfero/noosfero

View on GitHub

Showing 1,643 of 1,643 total issues

Function pjax has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function pjax(options) {
  options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options)

  if ($.isFunction(options.url)) {
    options.url = options.url()
Severity: Major
Found in plugins/pjax/public/javascripts/jquery.pjax.js - About 4 hrs to fix

    Class PgSearchPlugin has 36 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class PgSearchPlugin < Noosfero::Plugin
      include SearchHelper
    
      def self.plugin_name
        "Postgres Full-Text Search"
    Severity: Minor
    Found in plugins/pg_search/lib/pg_search_plugin.rb - About 4 hrs to fix

      Function load_node_html has 116 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  load_node_html : function (obj, s_call, e_call) {
                      var d,
                          s = this.get_settings().html_data,
                          error_func = function () {},
                          success_func = function () {};

        Class Order has 35 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class OrdersPlugin::Order < ApplicationRecord
          # if abstract_class is true then it will trigger https://github.com/rails/rails/issues/20871
          # self.abstract_class = true
        
          Statuses = ::OrdersPlugin::Item::Statuses
        Severity: Minor
        Found in plugins/orders/models/orders_plugin/order.rb - About 4 hrs to fix

          Class Comment has 35 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class Comment < ApplicationRecord
            include Notifiable
          
            SEARCHABLE_FIELDS = {
              title: { label: _("Title"), weight: 10 },
          Severity: Minor
          Found in app/models/comment.rb - About 4 hrs to fix

            Class Theme has 35 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Theme
              class << self
                def system_themes
                  Dir.glob(File.join(system_themes_dir, "*")).map do |path|
                    config_file = File.join(path, "theme.yml")
            Severity: Minor
            Found in app/models/theme.rb - About 4 hrs to fix

              Class AccountController has 35 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class AccountController < ApplicationController
                no_design_blocks
              
                before_action :login_required, :require_login_for_environment, only: [:activation_question, :accept_terms, :activate_enterprise, :change_password]
                before_action :redirect_if_logged_in, only: [:login, :signup, :activate]
              Severity: Minor
              Found in app/controllers/public/account_controller.rb - About 4 hrs to fix

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

                    function de_at__processRelativeTime(number, withoutSuffix, key, isFuture) {
                        var format = {
                            'm': ['eine Minute', 'einer Minute'],
                            'h': ['eine Stunde', 'einer Stunde'],
                            'd': ['ein Tag', 'einem Tag'],
                Severity: Major
                Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 4 hrs to fix
                plugins/orders/public/javascripts/moment-with-locales.js on lines 4643..4655

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

                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

                                    case "enabled":
                                        var enabled = {};
                                        this.each(function () {
                                            var $self = $(this);
                                            var options = $self.data('social-share-privacy-options');
                plugins/social_share_privacy/public/socialshareprivacy/javascripts/socialshareprivacy.js on lines 441..450

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

                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

                                    case "disabled":
                                        var disabled = {};
                                        this.each(function () {
                                            var $self = $(this);
                                            var options = $self.data('social-share-privacy-options');
                plugins/social_share_privacy/public/socialshareprivacy/javascripts/socialshareprivacy.js on lines 430..439

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

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                                if(this.data.themes) { 
                                    if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
                                    if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
                                    $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme); 
                                }
                plugins/display_content/public/javascripts/jstree-v.pre1.0/jquery.jstree.js on lines 2490..2494

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

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                                        if(this.data.themes) { 
                                            if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
                                            if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
                                            $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme); 
                                        }
                plugins/display_content/public/javascripts/jstree-v.pre1.0/jquery.jstree.js on lines 2678..2682

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

                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

                    function de__processRelativeTime(number, withoutSuffix, key, isFuture) {
                        var format = {
                            'm': ['eine Minute', 'einer Minute'],
                            'h': ['eine Stunde', 'einer Stunde'],
                            'd': ['ein Tag', 'einem Tag'],
                Severity: Major
                Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 4 hrs to fix
                plugins/orders/public/javascripts/moment-with-locales.js on lines 4579..4591

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

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

                  var Tokenfield = function (element, options) {
                    var _self = this
                
                    this.$element = $(element)
                    this.textDirection = this.$element.css('direction');
                Severity: Major
                Found in plugins/fb_app/public/javascripts/bootstrap-tokenfield.js - About 4 hrs to fix

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

                                      this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
                  plugins/display_content/public/javascripts/jstree-v.pre1.0/jquery.jstree.js on lines 483..483

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                                      this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
                  plugins/display_content/public/javascripts/jstree-v.pre1.0/jquery.jstree.js on lines 484..484

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

                  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

                  Class Cycle has 34 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class OrdersCyclePlugin::Cycle < ApplicationRecord
                    attr_accessible :profile, :status, :name, :description, :opening_message
                  
                    attr_accessible :start, :finish, :delivery_start, :delivery_finish
                    attr_accessible :start_date, :start_time, :finish_date, :finish_time, :delivery_start_date, :delivery_start_time, :delivery_finish_date, :delivery_finish_time,
                  Severity: Minor
                  Found in plugins/orders_cycle/models/orders_cycle_plugin/cycle.rb - About 4 hrs to fix

                    File sniffer.js has 347 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    sniffer = {
                    
                      search: {
                    
                        filters: { __categoryIds: [], distance: 0, circle: undefined, homePosition: undefined },
                    Severity: Minor
                    Found in plugins/sniffer/public/javascripts/sniffer.js - About 4 hrs to fix

                      Function load_node_json has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  load_node_json : function (obj, s_call, e_call) {
                                      var s = this.get_settings().json_data, d,
                                          error_func = function () {},
                                          success_func = function () {};
                                      obj = this._get_node(obj);

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

                                meridiemHour : function (hour, meridiem) {
                                    if (hour === 12) {
                                        hour = 0;
                                    }
                                    if (meridiem === 'रात') {
                        Severity: Major
                        Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 4 hrs to fix
                        plugins/orders/public/javascripts/moment-with-locales.js on lines 7179..7192

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

                        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