diaspora/diaspora

View on GitHub

Showing 64 of 4,306 total issues

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

  word: "\\u0030-\\u0039" +
        "\\u0041-\\u005a" +
        "\\u005f-\\u005f" +
        "\\u0061-\\u007a" +
        "\\u00aa-\\u00aa" +
Severity: Major
Found in lib/assets/javascripts/posix-bracket-expressions.js and 1 other location - About 1 wk to fix
lib/assets/javascripts/posix-bracket-expressions.js on lines 686..1119

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

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

  alnum: "\\u0030-\\u0039" +
         "\\u0041-\\u005a" +
         "\\u0061-\\u007a" +
         "\\u00aa-\\u00aa" +
         "\\u00b5-\\u00b5" +
Severity: Major
Found in lib/assets/javascripts/posix-bracket-expressions.js and 1 other location - About 1 wk to fix
lib/assets/javascripts/posix-bracket-expressions.js on lines 5..438

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

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 posix-bracket-expressions.js has 883 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later

var PosixBracketExpressions = {
  // source: https://github.com/ruby/ruby/blob/ruby_2_4/enc/unicode/9.0.0/name2ctype.h#L3544
  word: "\\u0030-\\u0039" +
Severity: Major
Found in lib/assets/javascripts/posix-bracket-expressions.js - About 2 days to fix

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

    // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
    
    app.views.ResharesInfo = app.views.Base.extend({
    
      templateName : "reshares-info",
    Severity: Major
    Found in app/assets/javascripts/app/views/reshares_info_view.js and 1 other location - About 1 day to fix
    app/assets/javascripts/app/views/likes_info_view.js on lines 1..35

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

    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

    // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
    
    app.views.LikesInfo = app.views.Base.extend({
    
      templateName : "likes-info",
    Severity: Major
    Found in app/assets/javascripts/app/views/likes_info_view.js and 1 other location - About 1 day to fix
    app/assets/javascripts/app/views/reshares_info_view.js on lines 1..35

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

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

    class User < ApplicationRecord
      include AuthenticationToken
      include Connecting
      include Querying
      include SocialActions
    Severity: Major
    Found in app/models/user.rb - About 1 day to fix

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

            .destroy({
              success: function(){
                app.events.trigger("aspect_membership:destroy", {
                  membership: {
                    aspectId: app.aspect.get("id"),
      Severity: Major
      Found in app/assets/javascripts/app/views/contact_view.js and 1 other location - About 5 hrs to fix
      app/assets/javascripts/app/views/contact_view.js on lines 38..53

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

      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

          },{
            success: function(){
              app.events.trigger("aspect_membership:create", {
                membership: {
                  aspectId: app.aspect.get("id"),
      Severity: Major
      Found in app/assets/javascripts/app/views/contact_view.js and 1 other location - About 5 hrs to fix
      app/assets/javascripts/app/views/contact_view.js on lines 62..77

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

      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

            $.ajax({
              url: url,
              dataType: "json",
              type: "POST",
              beforeSend: function() {
      Severity: Major
      Found in app/assets/javascripts/mobile/mobile_post_actions.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/mobile/mobile_post_actions.js on lines 59..73

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

      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

            $.ajax({
              url: url,
              dataType: "json",
              type: "DELETE",
              beforeSend: function() {
      Severity: Major
      Found in app/assets/javascripts/mobile/mobile_post_actions.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/mobile/mobile_post_actions.js on lines 30..44

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

      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

        presenter : function() {
          return _.extend(this.defaultPresenter(), {
            authorIsCurrentUser : app.currentUser.isAuthorOf(this.model), 
            showPost : this.showPost(),
            text : app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people"))
      Severity: Major
      Found in app/assets/javascripts/app/views/post_view.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/app/views/single-post-viewer/single_post_content_view.js on lines 47..53

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

      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

        presenter : function() {
          return _.extend(this.defaultPresenter(), {
            authorIsCurrentUser :app.currentUser.isAuthorOf(this.model),
            showPost : this.showPost(),
            text : app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people"))
      app/assets/javascripts/app/views/post_view.js on lines 4..10

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

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

      function createUploader(){
         var aspectIds = gon.preloads.aspect_ids;
      
        new qq.FineUploaderBasic({
          element: document.getElementById("file-upload-publisher"),
      Severity: Major
      Found in app/assets/javascripts/mobile/mobile_file_uploader.js - About 3 hrs to fix

        Function initialize has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          initialize: function() {
            new qq.FineUploaderBasic({
              element: document.getElementById("file-upload"),
              validation: {
                allowedExtensions: ["jpg", "jpeg", "png"],
        Severity: Major
        Found in app/assets/javascripts/helpers/profile_photo_uploader.js - About 2 hrs to fix

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

            toggled: function(e) {
              var el = $(e.target);
              var parent = el.parents('.question');
          
              parent.children('.answer.hideable').toggle();
          Severity: Major
          Found in app/assets/javascripts/app/views/help_section_view.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/app/views/faq_question_view.js on lines 30..38

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

          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

            toggled: function(e) {
              var el = $(e.target);
              var parent = el.parents('.question');
          
              parent.children('.answer').toggle();
          Severity: Major
          Found in app/assets/javascripts/app/views/faq_question_view.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/app/views/help_section_view.js on lines 28..36

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

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

            app.helpers.textFormatter = function(text, mentions) {
              mentions = mentions ? mentions : [];
          
              var md = window.markdownit({
                breaks:      true,
          Severity: Major
          Found in app/assets/javascripts/app/helpers/text_formatter.js - About 2 hrs to fix

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

                if( this.dropdown.find("li.selected").length === 0 ) {
                  var msg = Diaspora.I18n.t("aspect_dropdown.started_sharing_with", { "name": this._name() });
                  startSharing = true;
                  app.flashMessages.success(msg);
                }
            Severity: Major
            Found in app/assets/javascripts/app/views/aspect_membership_view.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/app/views/aspect_membership_view.js on lines 148..152

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

            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

                if (this.$el.find("li.selected").length === 0) {
                  var msg = Diaspora.I18n.t("aspect_dropdown.stopped_sharing_with", { "name": this._name() });
                  stopSharing = true;
                  app.flashMessages.success(msg);
                }
            Severity: Major
            Found in app/assets/javascripts/app/views/aspect_membership_view.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/app/views/aspect_membership_view.js on lines 110..114

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

            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

                    deactivate: function(){
                      bottomBar.removeClass("active").addClass("inactive");
                      this.getShowCommentsLink().removeClass("active");
                      this.getShowCommentsLink().find("i").addClass("entypo-chevron-down").removeClass("entypo-chevron-up");
                    }
            Severity: Major
            Found in app/assets/javascripts/mobile/mobile_comments.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/mobile/mobile_comments.js on lines 146..150

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

            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