studpad/studpad

View on GitHub

Showing 280 of 280 total issues

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

  $.emojiarea.icons = {
      ':smiley:'         : 'smile1.png',
      ':blush:'          : 'smile2.png',
      ':wink:'           : 'smile4.png',
      ':yum:'            : 'smile9.png',
Severity: Major
Found in app/assets/javascripts/emotions.js and 1 other location - About 1 hr to fix
app/assets/javascripts/my_scripts.js on lines 164..176

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

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.props.post.linkdata.title) {
          link_title = (
            <header className = 'post-type-link-title'>
              {this.props.post.linkdata.title}
            </header>)
Severity: Major
Found in app/assets/javascripts/components/post_modal_content.js.jsx and 1 other location - About 1 hr to fix
app/assets/javascripts/components/post_modal_content.js.jsx on lines 130..135

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

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.props.post.linkdata.description) {
          link_description = (
            <div className = 'post-type-link-description'>
              {this.props.post.linkdata.description}
            </div>)
Severity: Major
Found in app/assets/javascripts/components/post_modal_content.js.jsx and 1 other location - About 1 hr to fix
app/assets/javascripts/components/post_modal_content.js.jsx on lines 124..129

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

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

  $.emojiarea.icons = {
      ':smiley:'         : 'smile1.png',
      ':blush:'          : 'smile2.png',
      ':wink:'           : 'smile4.png',
      ':yum:'            : 'smile9.png',
Severity: Major
Found in app/assets/javascripts/my_scripts.js and 1 other location - About 1 hr to fix
app/assets/javascripts/emotions.js on lines 462..474

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

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

            transformRightStr = support.support3d ? 'translate3d(' + Number( getViewportW() / 2 + itemWidth / 2 ) + 'px, 0, -150px)' : 'translate(' + Number( getViewportW() / 2 + itemWidth / 2 ) + 'px)',
Severity: Major
Found in app/assets/stylesheets/explore.js and 1 other location - About 1 hr to fix
app/assets/stylesheets/explore.js on lines 190..190

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

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

            transformLeftStr = support.support3d ? 'translate3d(-' + Number( getViewportW() / 2 + itemWidth / 2 ) + 'px, 0, -150px)' : 'translate(-' + Number( getViewportW() / 2 + itemWidth / 2 ) + 'px)',
Severity: Major
Found in app/assets/stylesheets/explore.js and 1 other location - About 1 hr to fix
app/assets/stylesheets/explore.js on lines 191..191

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

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

  Tab.prototype.activate = function (element, container, callback) {
    var $active    = container.find('> .active')
    var transition = callback
      && $.support.transition
      && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
Severity: Minor
Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

    Function updateOption has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        updateOption: function(value, data) {
          var self = this;
          var $item, $item_new;
          var value_new, index_item, cache_items, cache_options, order_old;
    
    
    Severity: Minor
    Found in app/assets/javascripts/selectize_fixed.js - About 1 hr to fix

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

        $(".btn-follow").mouseout(function(){
            $(this).addClass('btn-follow-on').addClass('btn-primary').removeClass('btn-st-red');
            $(this).html('Читаю');
        });
      Severity: Major
      Found in app/assets/javascripts/my_scripts.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/my_scripts.js on lines 285..288

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

      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

        $(".btn-follow").mouseover(function(){
            $(this).removeClass('btn-follow-on').removeClass('btn-primary').addClass('btn-st-red');
            $(this).html('Отмена');
        });
      Severity: Major
      Found in app/assets/javascripts/my_scripts.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/my_scripts.js on lines 289..292

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

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

        render: function() {
      
          var className;
          if (this.props.className) {
            className = this.props.className;
      Severity: Minor
      Found in app/assets/javascripts/react-dropzone.js.jsx - About 1 hr to fix

        Function render has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render: function () {
            var comments = this.props.comments;
            if (!this.state.show_all){
              comments = comments.slice(-3);
            }
        Severity: Minor
        Found in app/assets/javascripts/components/comment_list.js.jsx - About 1 hr to fix

          Function onChangeLink has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            onChangeLink: function(event) {
              url = event.target.value;
              console.log(url);
              if (this.state.timeout_id)
                clearTimeout(this.state.timeout_id);
          Severity: Minor
          Found in app/assets/javascripts/components/post_modal_form.js.jsx - About 1 hr to fix

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

                function CBPGridGallery( el, options ) {
                    this.el = el;
                    this.options = extend( {}, this.options );
                      extend( this.options, options );
                      this._init();
            Severity: Major
            Found in app/assets/stylesheets/explore.js and 1 other location - About 1 hr to fix
            public/js/cbpGridGallery.js on lines 55..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 64.

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

                if (!self) {
                  self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
                  $(obj.currentTarget).data('bs.' + this.type, self)
                }
            Severity: Major
            Found in app/assets/javascripts/bootstrap.js and 2 other locations - About 1 hr to fix
            app/assets/javascripts/bootstrap.js on lines 1399..1402
            app/assets/javascripts/bootstrap.js on lines 1703..1706

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

            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 CBPGridGallery( el, options ) {
                    this.el = el;
                    this.options = extend( {}, this.options );
                      extend( this.options, options );
                      this._init();
            Severity: Major
            Found in public/js/cbpGridGallery.js and 1 other location - About 1 hr to fix
            app/assets/stylesheets/explore.js on lines 55..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 64.

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

                if (!self) {
                  self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
                  $(obj.currentTarget).data('bs.' + this.type, self)
                }
            Severity: Major
            Found in app/assets/javascripts/bootstrap.js and 2 other locations - About 1 hr to fix
            app/assets/javascripts/bootstrap.js on lines 1362..1365
            app/assets/javascripts/bootstrap.js on lines 1703..1706

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

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

                  if (!self) {
                    self = new this.constructor(e.currentTarget, this.getDelegateOptions())
                    $(e.currentTarget).data('bs.' + this.type, self)
                  }
            Severity: Major
            Found in app/assets/javascripts/bootstrap.js and 2 other locations - About 1 hr to fix
            app/assets/javascripts/bootstrap.js on lines 1362..1365
            app/assets/javascripts/bootstrap.js on lines 1399..1402

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

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

              Collapse.prototype.show = function () {
                if (this.transitioning || this.$element.hasClass('in')) return
            
                var activesData
                var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
            Severity: Minor
            Found in app/assets/javascripts/bootstrap.js - About 1 hr to fix

              Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render: function() {
                  return (
                  <ReactBootstrap.Modal
                    onHide={this.hide}
                    backdrop='static'
              Severity: Minor
              Found in app/assets/javascripts/components/post_modal_form.js.jsx - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language