studpad/studpad

View on GitHub

Showing 280 of 280 total issues

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

    if(nextStation == 'recommend-people'){
      var description = "После регистрации Вам доступны публикации только тех, кто имеет одинаковую с Вами специализацию . Если Вы хотите получать больше интересных публикаций , то выбирайте и читайте тех, кто Вам интересен. Тогда Вы будете видеть всё, что они опубликовали у себя в микроблоге.";
      $('.first-left-block').css('z-index', '999');
      $('.follow-offer').css('z-index', '2000').css('position', 'relative');
      $('.description-hdiw').removeClass('description-hdiw-last-publicators').addClass('description-hdiw-' + nextStation).html(description);
Severity: Major
Found in app/assets/javascripts/my_scripts.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/my_scripts.js on lines 325..333

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

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(nextStation == 'publications'){
      var description = "Здесь Вы можете увидеть все публикации коллег Вашей специализации. Вы можете оставить комментарий или же просто сказать спасибо, ведь публиковали именно для Вас! Если Вы хотите получать больше публикаций, для этого читайте больше людей!";
      $('.wrap-mike').css('z-index', '999');
      $('.post-container').css('z-index', '2000').css('position', 'relative');
      $('.description-hdiw').removeClass('description-hdiw-mike-speach').addClass('description-hdiw-' + nextStation).html(description);
Severity: Major
Found in app/assets/javascripts/my_scripts.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/my_scripts.js on lines 355..363

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

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

    posts = posts.map(function(p){
      if (p.id == id){
        if (p.current_like){
          p.likes -= 1;
          p.current_like = false;
Severity: Major
Found in app/assets/javascripts/explore_grid.js.jsx and 1 other location - About 4 hrs to fix
app/assets/javascripts/components/post_box.js.jsx on lines 201..214

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

    posts = posts.map(function(p){
      if (p.id == id){
        if (p.current_like){
          p.likes -= 1;
          p.current_like = false;
Severity: Major
Found in app/assets/javascripts/components/post_box.js.jsx and 1 other location - About 4 hrs to fix
app/assets/javascripts/explore_grid.js.jsx on lines 110..123

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

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.affix')
      var options = typeof option == 'object' && option
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/bootstrap.js on lines 2008..2017

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

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

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.scrollspy')
      var options = typeof option == 'object' && option
Severity: Major
Found in app/assets/javascripts/bootstrap.js and 1 other location - About 4 hrs to fix
app/assets/javascripts/bootstrap.js on lines 2320..2329

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

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

  render: function(){
    photos = this.props.photos;
    photos = photos.map(function (p, index) {
      return (
        <div key={index} className="usual-post-photo action-create-element-post">
Severity: Major
Found in app/assets/javascripts/components/photos_box.js.jsx - About 3 hrs to fix

    Function refreshOptions has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        refreshOptions: function(triggerDropdown) {
          var i, j, k, n, groups, groups_order, option, option_html, optgroup, optgroups, html, html_children, has_create_option;
          var $active, $active_before, $create;
    
          if (typeof triggerDropdown === 'undefined') {
    Severity: Major
    Found in app/assets/javascripts/selectize_fixed.js - About 3 hrs to fix

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

        function Plugin(option) {
          return this.each(function () {
            var $this = $(this)
            var data  = $this.data('bs.alert')
      
      
      Severity: Major
      Found in app/assets/javascripts/bootstrap.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/bootstrap.js on lines 874..882

      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

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

        function Plugin(option) {
          return this.each(function () {
            var $this = $(this)
            var data  = $this.data('bs.dropdown')
      
      
      Severity: Major
      Found in app/assets/javascripts/bootstrap.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/bootstrap.js on lines 142..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 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 render has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render(){
          if (!this.props.post) return null;
          console.log(this.props.post)
          var post = this.props.post;
          var author = post.author;
      Severity: Major
      Found in app/assets/javascripts/components/show_explore_post.js.jsx - About 3 hrs to fix

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

          render(){
            var self = this;
            var checked_count = $.grep(this.state.users, function(user){
                return user.checked;
              }).length;
        Severity: Major
        Found in app/assets/javascripts/components/follow_box.js.jsx - About 3 hrs to fix

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

              if (this.props.style) {
                style = this.props.style;
                activeStyle = this.props.activeStyle;
              } else if (!className) {
                style = {
          Severity: Major
          Found in app/assets/javascripts/react-dropzone.js.jsx and 1 other location - About 3 hrs to fix
          app/assets/javascripts/react-dropzone.js.jsx on lines 329..343

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

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

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

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

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

          Refactorings

          Further Reading

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

              if (this.props.style) {
                style = this.props.style;
                activeStyle = this.props.activeStyle;
              } else if (!className) {
                style = {
          Severity: Major
          Found in app/assets/javascripts/react-dropzone.js.jsx and 1 other location - About 3 hrs to fix
          app/assets/javascripts/react-dropzone.js.jsx on lines 153..167

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

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

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

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

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

          Refactorings

          Further Reading

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

              if (this.props.className) {
                className = this.props.className;
                if (this.state.isDragActive) {
                  className += ' ' + this.props.activeClassName;
                };
          Severity: Major
          Found in app/assets/javascripts/react-dropzone.js.jsx and 1 other location - About 3 hrs to fix
          app/assets/javascripts/react-dropzone.js.jsx on lines 318..326

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

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

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

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

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

          Refactorings

          Further Reading

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

              if (this.props.className) {
                className = this.props.className;
                if (this.state.isDragActive) {
                  className += ' ' + this.props.activeClassName;
                };
          Severity: Major
          Found in app/assets/javascripts/react-dropzone.js.jsx and 1 other location - About 3 hrs to fix
          app/assets/javascripts/react-dropzone.js.jsx on lines 142..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 100.

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

            render: function(){
              var style = {
                background: 'url(' + this.props.comment.author.avatar + ') no-repeat',
                backgroundSize: 'cover'
              };
          Severity: Major
          Found in app/assets/javascripts/components/comment.js.jsx - About 3 hrs to fix

            File post_box.js.jsx has 300 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            const PostBox = React.createClass({
              //BEGIN***************************************************DECLARE
              propTypes: {
                group_id: React.PropTypes.number,
                //show_panel: React.PropTypes.boolean,
            Severity: Minor
            Found in app/assets/javascripts/components/post_box.js.jsx - About 3 hrs to fix

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

                      <div className = 'post-type-material-item'>
                        <div className = 'post-type-material-icon'>
                        </div>
                        <div className = 'post-type-material-text'>
                          <a href={this.props.url} target='blank'>
              Severity: Major
              Found in app/assets/javascripts/components/post_modal_content.js.jsx and 1 other location - About 3 hrs to fix
              app/assets/javascripts/components/post_modal_content.js.jsx on lines 268..276

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

              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

                      <div className = 'post-type-material-item'>
                        <div className = 'post-type-material-icon'>
                        </div>
                        <div className = 'post-type-material-text'>
                          <a href={this.props.url} target='blank'>
              Severity: Major
              Found in app/assets/javascripts/components/post_modal_content.js.jsx and 1 other location - About 3 hrs to fix
              app/assets/javascripts/components/post_modal_content.js.jsx on lines 248..256

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

              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