Noosfero/noosfero

View on GitHub

Showing 1,643 of 1,643 total issues

File moment-with-locales.js has 8154 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
    typeof define === 'function' && define.amd ? define(factory) :
    global.moment = factory()
}(this, function () { 'use strict';
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js - About 3 wks to fix

    File jquery-1.8.3.js has 6532 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.8.3
     * http://jquery.com/
     *
     * Includes Sizzle.js

      File jquery.jstree.js has 4203 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * jsTree 1.0-rc3
       * http://jstree.com/
       *
       * Copyright (c) 2010 Ivan Bozhanov (vakata.com)

        Function SyntaxHighlighter has a Cognitive Complexity of 380 (exceeds 5 allowed). Consider refactoring.
        Open

        if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() { 
        
        // Shortcut object which will be assigned to the SyntaxHighlighter variable.
        // This is a shorthand for local reference in order to avoid long namespace 
        // references to SyntaxHighlighter.whatever...

        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

        Function SyntaxHighlighter has 1012 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        if (!window.SyntaxHighlighter) var SyntaxHighlighter = function() { 
        
        // Shortcut object which will be assigned to the SyntaxHighlighter variable.
        // This is a shorthand for local reference in order to avoid long namespace 
        // references to SyntaxHighlighter.whatever...

          File !script.js has 1320 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * SyntaxHighlighter
           * http://alexgorbatchev.com/
           *
           * SyntaxHighlighter is donationware. If you are using it, please donate.

            Class Profile has 169 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Profile < ApplicationRecord
              attr_accessible :name, :identifier, :access, :nickname,
                              :custom_footer, :custom_header, :address, :zip_code, :contact_phone,
                              :image_builder, :top_image_builder, :description, :closed, :template_id, :environment, :lat,
                              :lng, :is_template, :fields_privacy, :preferred_domain_id, :category_ids,
            Severity: Major
            Found in app/models/profile.rb - About 3 days to fix

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

                  var bg = _moment__default.defineLocale('bg', {
                      months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
                      monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
                      weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
                      weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
              Severity: Major
              Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 2 days to fix
              plugins/orders/public/javascripts/moment-with-locales.js on lines 6967..7040

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

              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 mk = _moment__default.defineLocale('mk', {
                      months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'),
                      monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
                      weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'),
                      weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
              Severity: Major
              Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 2 days to fix
              plugins/orders/public/javascripts/moment-with-locales.js on lines 3688..3761

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

              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

              File application_helper.rb has 1058 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module ApplicationHelper
                include PermissionNameHelper
              
                include UrlHelper
              
              
              Severity: Major
              Found in app/helpers/application_helper.rb - About 2 days to fix

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

                    var cs = _moment__default.defineLocale('cs', {
                        months : cs__months,
                        monthsShort : cs__monthsShort,
                        monthsParse : (function (months, monthsShort) {
                            var i, _monthsParse = [];
                Severity: Major
                Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 2 days to fix
                plugins/orders/public/javascripts/moment-with-locales.js on lines 8105..8187

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

                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 sk = _moment__default.defineLocale('sk', {
                        months : sk__months,
                        monthsShort : sk__monthsShort,
                        monthsParse : (function (months, monthsShort) {
                            var i, _monthsParse = [];
                Severity: Major
                Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 2 days to fix
                plugins/orders/public/javascripts/moment-with-locales.js on lines 4320..4402

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

                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

                File profile.rb has 1042 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class Profile < ApplicationRecord
                  attr_accessible :name, :identifier, :access, :nickname,
                                  :custom_footer, :custom_header, :address, :zip_code, :contact_phone,
                                  :image_builder, :top_image_builder, :description, :closed, :template_id, :environment, :lat,
                                  :lng, :is_template, :fields_privacy, :preferred_domain_id, :category_ids,
                Severity: Major
                Found in app/models/profile.rb - About 2 days to fix

                  File application.js has 1025 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // Place your application-specific JavaScript functions and classes here
                  // This file is automatically included by javascript_include_tag :defaults
                  /*
                  * third party libraries
                  *= require vendor/lodash.js
                  Severity: Major
                  Found in public/javascripts/application.js - About 2 days to fix

                    File daterangepicker.js has 1010 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /**
                    * @version: 1.3.21
                    * @author: Dan Grossman http://www.dangrossman.info/
                    * @copyright: Copyright (c) 2012-2015 Dan Grossman. All rights reserved.
                    * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
                    Severity: Major
                    Found in plugins/orders/public/javascripts/daterangepicker.js - About 2 days to fix

                      Class Environment has 122 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Environment < ApplicationRecord
                        attr_accessible :name, :is_default, :signup_welcome_text_subject,
                                        :signup_welcome_text_body, :terms_of_use,
                                        :message_for_disabled_enterprise, :news_amount_by_folder,
                                        :default_language, :languages, :description,
                      Severity: Major
                      Found in app/models/environment.rb - About 2 days to fix

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

                            var id = _moment__default.defineLocale('id', {
                                months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
                                monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
                                weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
                                weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
                        Severity: Major
                        Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 2 days to fix
                        plugins/orders/public/javascripts/moment-with-locales.js on lines 7216..7281

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

                        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 ms_my = _moment__default.defineLocale('ms-my', {
                                months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'),
                                monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
                                weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
                                weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
                        Severity: Major
                        Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 2 days to fix
                        plugins/orders/public/javascripts/moment-with-locales.js on lines 6176..6241

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

                        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 Article has 120 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Article < ApplicationRecord
                          module Editor
                            TEXTILE = "textile"
                            TINY_MCE = "tiny_mce"
                            RAW_HTML = "raw_html"
                        Severity: Major
                        Found in app/models/article.rb - About 2 days to fix

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

                                                      if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
                                                          d = $(d);
                                                          if(!d.is("ul")) { d = $("<ul />").append(d); }
                                                          if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
                                                          else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
                          plugins/display_content/public/javascripts/jstree-v.pre1.0/jquery.jstree.js on lines 4111..4134

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

                          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