sharetribe/sharetribe

View on GitHub

Showing 1,230 of 1,230 total issues

File sortable.js has 2871 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**!
 * Sortable 1.10.2
 * @author    RubaXa   <trash@rubaxa.org>
 * @author    owenm    <owen23355@gmail.com>
 * @license MIT
Severity: Major
Found in app/assets/javascripts/admin2/sortable.js - About 1 wk to fix

    File spectrum.js has 1808 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Spectrum Colorpicker v1.8.0
    // https://github.com/bgrins/spectrum
    // Author: Brian Grinstead
    // License: MIT
    
    
    Severity: Major
    Found in app/assets/javascripts/admin2/spectrum.js - About 4 days to fix

      Function spectrum has 625 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function spectrum(element, o) {
      
              var opts = instanceOptions(o, element),
                  flat = opts.flat,
                  showSelectionPalette = opts.showSelectionPalette,
      Severity: Major
      Found in app/assets/javascripts/admin2/spectrum.js - About 3 days to fix

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

        window.ST.initializeTransactionSearchFormSelector = function() {
          $(".status-select-button").click(function(){
            $(".status-select-dropdown").show();
            setTimeout(function() { document.addEventListener('mousedown', outsideClickListener);}, 300);
          });
        Severity: Major
        Found in app/assets/javascripts/admin/transactions.js and 1 other location - About 2 days to fix
        app/assets/javascripts/admin/testimonials.js on lines 61..97

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

        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

        window.ST.initializeTestimonialSearchFormSelector = function() {
          $(".status-select-button").click(function(){
            $(".status-select-dropdown").show();
            setTimeout(function() { document.addEventListener('mousedown', outsideClickListener);}, 300);
          });
        Severity: Major
        Found in app/assets/javascripts/admin/testimonials.js and 1 other location - About 2 days to fix
        app/assets/javascripts/admin/transactions.js on lines 26..62

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

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

          function MultiDragPlugin() {
            function MultiDrag(sortable) {
              // Bind all private methods
              for (var fn in this) {
                if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
        Severity: Major
        Found in app/assets/javascripts/admin2/sortable.js - About 2 days to fix

          File kassi.js has 757 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Custom Javascript functions for Sharetribe
          // Add custom validation methods
          
          function add_validator_methods() {
          
          
          Severity: Major
          Found in app/assets/javascripts/kassi.js - About 1 day to fix

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

            const listingCardTemplate = (title, perUnit, price, distance) => (
              r(ListingCard,
                {
                  color: '#347F9D',
                  listing: new ListingModel({
            client/app/components/sections/SearchPage/SearchPage.story.js on lines 14..54

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

            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

            const listingCardTemplate = (title, perUnit, price, distance) => (
              r(ListingCard,
                {
                  color: '#347F9D',
                  listing: new ListingModel({
            client/app/components/composites/ListingCardPanel/ListingCardPanel.story.js on lines 20..60

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

            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 693 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module ApplicationHelper
            
              # Removes whitespaces from HAML expressions
              # if you add two elements on two lines; the white space creates a space between the elements (in some browsers)
              def one_line_for_html_safe_content(&block)
            Severity: Major
            Found in app/helpers/application_helper.rb - About 1 day to fix

              Function imageUploader has 295 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              window.ST.imageUploader = function(listings, opts) {
                var elementManager = ST.imageUploadElementManager($("#image-uploader-container"));
                var directUploadToS3 = !!opts.s3Fields && !!opts.s3UploadPath;
              
                var extraPlaceholders = 2;
              Severity: Major
              Found in app/assets/javascripts/image_uploader.js - About 1 day to fix

                File example_data.rb has 574 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                module CustomLandingPage
                  # rubocop:disable Metrics/ModuleLength
                  module ExampleData
                
                    # TODO Document the expected JSON structure here
                Severity: Major
                Found in app/services/custom_landing_page/example_data.rb - About 1 day to fix

                  Method admin_links_for has 234 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def admin_links_for(community)
                      links = [
                        {
                          :topic => :general,
                          :text => t("admin.communities.getting_started.getting_started"),
                  Severity: Major
                  Found in app/helpers/application_helper.rb - About 1 day to fix

                    Class PaymentSettingsPresenter has 63 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Person::PaymentSettingsPresenter
                      include Person::PaymentSettingsCommon
                    
                      private
                    
                    
                    Severity: Major
                    Found in app/presenters/person/payment_settings_presenter.rb - About 1 day to fix

                      File googlemaps.js has 547 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      var directionsDisplay;
                      var directionsService;
                      var marker;
                      var geocoder;
                      var map;
                      Severity: Major
                      Found in app/assets/javascripts/googlemaps.js - About 1 day to fix

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

                            const winder = {
                              wrapper: this.props.sideWinderWrapper,
                              maxWidth: cssVariables['--ManageAvailability_maxWidth'],
                              minWidth: cssVariables['--ManageAvailability_minWidth'],
                              height: this.state.viewportHeight,
                        client/app/components/sections/ListingWorkingHours/ListingWorkingHours.js on lines 90..111

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

                        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

                            const winder = {
                              wrapper: this.props.sideWinderWrapper,
                              maxWidth: cssVariables['--ManageAvailabilityWorkingHours_maxWidth'],
                              minWidth: cssVariables['--ManageAvailability_minWidth'],
                              height: this.state.viewportHeight,
                        client/app/components/sections/ManageAvailability/ManageAvailability.js on lines 156..177

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

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

                        class Person < ApplicationRecord
                        
                          include ErrorsHelper
                          include ApplicationHelper
                          include DeletePerson
                        Severity: Major
                        Found in app/models/person.rb - About 1 day to fix

                          Method build_default_test_actions has 203 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def build_default_test_actions
                                identity = -> (val, _) { val }
                          
                                {
                                  get_express_checkout_details: PaypalAction.def_action(
                          Severity: Major
                          Found in lib/services/paypal_service/test_merchant.rb - About 1 day to fix

                            Function _onDragOver has 201 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                _onDragOver: function _onDragOver(
                                /**Event*/
                                evt) {
                                  var el = this.el,
                                      target = evt.target,
                            Severity: Major
                            Found in app/assets/javascripts/admin2/sortable.js - About 1 day to fix
                              Severity
                              Category
                              Status
                              Source
                              Language