ConnorWiseman/jcink-custom-structure

View on GitHub
src/cs.js

Summary

Maintainability
F
2 wks
Test Coverage

File cs.js has 1047 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @file
 * A DOM manipilation utility library for the version of IPB running on the
 * free forum hosting service, Jcink, that reads table information and accepts
 * a user-defined template for text replacement. Allows for the structuring
Severity: Major
Found in src/cs.js - About 2 days to fix

    Function execute has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
    Open

    $cs.module.Profile.prototype.execute = function() {
        var portalStyle = document.getElementById('profile-heading'),
            defaultStyle = document.getElementById('profilename');
        // Check for personal portal style profiles first, since those are the default.
        if (portalStyle) {
    Severity: Minor
    Found in src/cs.js - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function execute has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
    Open

    $cs.module.Topics.prototype.execute = function() {
        var topicList = document.getElementById('topic-list');
        // If we couldn't find the default topic list, check what page we're on.
        if (!topicList) {
            if (this.config.activeTopics && window.location.href.indexOf('act=Search&CODE=getactive') > -1) {
    Severity: Minor
    Found in src/cs.js - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function execute has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
    Open

    $cs.module.Posts.prototype.execute = function() {
        // Make sure we're viewing a topic before executing.
        if (window.location.href.indexOf('showtopic') !== -1 || window.location.href.indexOf('ST') !== -1) {
            var posts = document.getElementsByClassName('post-normal');
    
    
    Severity: Minor
    Found in src/cs.js - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function execute has 220 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    $cs.module.Profile.prototype.execute = function() {
        var portalStyle = document.getElementById('profile-heading'),
            defaultStyle = document.getElementById('profilename');
        // Check for personal portal style profiles first, since those are the default.
        if (portalStyle) {
    Severity: Major
    Found in src/cs.js - About 1 day to fix

      Function readTable has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      $cs.module.Index.prototype.readTable = function(table, index) {
          // Acquire all the rows in the table.
          var rows = table.getElementsByTagName('tr');
      
          // Temporarily hide the table. It will be removed altogether later on.
      Severity: Minor
      Found in src/cs.js - About 6 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function execute has 122 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      $cs.module.Topics.prototype.execute = function() {
          var topicList = document.getElementById('topic-list');
          // If we couldn't find the default topic list, check what page we're on.
          if (!topicList) {
              if (this.config.activeTopics && window.location.href.indexOf('act=Search&CODE=getactive') > -1) {
      Severity: Major
      Found in src/cs.js - About 4 hrs to fix

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

        $cs.module.Posts.prototype.execute = function() {
            // Make sure we're viewing a topic before executing.
            if (window.location.href.indexOf('showtopic') !== -1 || window.location.href.indexOf('ST') !== -1) {
                var posts = document.getElementsByClassName('post-normal');
        
        
        Severity: Major
        Found in src/cs.js - About 3 hrs to fix

          Function initialize has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          $cs.module.Default.prototype.initialize = function(settings) {
              // Make sure we have an object to work with.
              settings = settings || {};
          
              // If we have an empty settings object, display an error message and return false.
          Severity: Minor
          Found in src/cs.js - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function readTable has 88 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          $cs.module.Index.prototype.readTable = function(table, index) {
              // Acquire all the rows in the table.
              var rows = table.getElementsByTagName('tr');
          
              // Temporarily hide the table. It will be removed altogether later on.
          Severity: Major
          Found in src/cs.js - About 3 hrs to fix

            Function createEditForm has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            $cs.module.Posts.prototype.createEditForm = function(forumId, topicId, postId, pageId, response, contentContainer) {
                // Create all our elements.
                var form = document.createElement('form'),
                    textarea = document.createElement('textarea'),
                    buttons = document.createElement('div'),
            Severity: Major
            Found in src/cs.js - About 3 hrs to fix

              Function execute has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              $cs.module.Stats.prototype.execute = function() {
                  var boardStats = document.getElementById('boardstats');
                  if (boardStats) {
                      var table = boardStats.lastElementChild;
                      // Hide the original table.
              Severity: Major
              Found in src/cs.js - About 2 hrs to fix

                Function formatQuoteCodeTags has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                $cs.module.Posts.prototype.formatQuoteCodeTags = function(tags) {
                    for (var m = tags.length; m > -1; m--) {
                        if (typeof tags[m] !== 'undefined' && tags[m].id == 'QUOTE-WRAP') {
                            tags[m].style.display = 'none';
                            var quoteTitleContents = tags[m].firstElementChild.firstElementChild.firstElementChild.innerHTML.slice(14, -1).split(' @ ');
                Severity: Minor
                Found in src/cs.js - About 1 hr to fix

                  Function execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  $cs.module.Stats.prototype.execute = function() {
                      var boardStats = document.getElementById('boardstats');
                      if (boardStats) {
                          var table = boardStats.lastElementChild;
                          // Hide the original table.
                  Severity: Minor
                  Found in src/cs.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                  $cs.module.Default.prototype.initialize = function(settings) {
                      // Make sure we have an object to work with.
                      settings = settings || {};
                  
                      // If we have an empty settings object, display an error message and return false.
                  Severity: Minor
                  Found in src/cs.js - About 1 hr to fix

                    Function formatQuoteCodeTags has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    $cs.module.Posts.prototype.formatQuoteCodeTags = function(tags) {
                        for (var m = tags.length; m > -1; m--) {
                            if (typeof tags[m] !== 'undefined' && tags[m].id == 'QUOTE-WRAP') {
                                tags[m].style.display = 'none';
                                var quoteTitleContents = tags[m].firstElementChild.firstElementChild.firstElementChild.innerHTML.slice(14, -1).split(' @ ');
                    Severity: Minor
                    Found in src/cs.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Avoid deeply nested control flow statements.
                    Open

                                        if (key in this) {
                                            this[key][subkey] = settings[key][subkey];
                                        }
                    Severity: Major
                    Found in src/cs.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (reputation.indexOf('pts') !== -1) {
                                              this.setValue('reputationTotal', reputation.split('pts [')[0]);
                                          } else {
                                              this.setValue('reputationTotal', '0');
                                          }
                      Severity: Major
                      Found in src/cs.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        else if (this.config.activeTopics) {
                                            this.setValue('folder', cells[0].innerHTML);
                                            this.setValue('marker', cells[1].innerHTML);
                                            var topicTitleLinks = cells[2].getElementsByTagName('a');
                                            if (topicTitleLinks[0].href.indexOf('view=getnewpost') === -1) {
                        Severity: Major
                        Found in src/cs.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          if (!viewingActiveTopics) {
                                              // This forum contains no topics. Display a message and call it good.
                                              topicsContent += '<div class="no-topics">' + this.config.noTopics + '</div>';
                                          } else if (this.config.activeTopics) {
                                              // This active topics list is blank. Display a message and call it good.
                          Severity: Major
                          Found in src/cs.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                            switch (titleContents) {
                                                case 'Announcements':
                                                    rowClass = ' announcement-topic';
                                                    topicsContent += '<div class="topic-title-row">' + this.config.announcementsDefault + '</div>';
                                                    break;
                            Severity: Major
                            Found in src/cs.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (postLinks[l].href.indexOf('act=Post&CODE=08') !== -1) {
                              
                                                      // ... attach an event listener.
                                                      postLinks[l].addEventListener('click', function(event) {
                                                          event.preventDefault();
                              Severity: Major
                              Found in src/cs.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if (child.nodeType === 1 && child.tagName === 'TD') {
                                                        if (child.parentNode.parentNode.parentNode === table) {
                                                            cells.push(child);
                                                        }
                                                    }
                                Severity: Major
                                Found in src/cs.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if (!topicTitle.getAttribute('title')) {
                                                          topicTitle = cells[2].getElementsByTagName('a')[1];
                                                      }
                                  Severity: Major
                                  Found in src/cs.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if (topicSpans[0].textContent.indexOf('(Pages ') !== -1) {
                                                            this.setValue('pagination', topicSpans[0].innerHTML);
                                                            this.setValue('topicDescription', topicSpans[1].textContent);
                                                        } else {
                                                            this.setValue('pagination', this.config.paginationDefault);
                                    Severity: Major
                                    Found in src/cs.js - About 45 mins to fix

                                      Function createEditForm has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      $cs.module.Posts.prototype.createEditForm = function(forumId, topicId, postId, pageId, response, contentContainer) {
                                      Severity: Minor
                                      Found in src/cs.js - About 45 mins to fix

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

                                                            if (topicSpans[0].textContent.indexOf('(Pages ') !== -1) {
                                                                this.setValue('pagination', topicSpans[0].innerHTML);
                                                                this.setValue('topicDescription', topicSpans[1].textContent);
                                                            } else {
                                                                this.setValue('pagination', this.config.paginationDefault);
                                        Severity: Major
                                        Found in src/cs.js and 1 other location - About 3 hrs to fix
                                        src/cs.js on lines 1176..1182

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

                                        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 (topicSpans[0].textContent.indexOf('(Pages ') !== -1) {
                                                                this.setValue('pagination', topicSpans[0].innerHTML);
                                                                this.setValue('topicDescription', topicSpans[1].textContent);
                                                            } else {
                                                                this.setValue('pagination', this.config.paginationDefault);
                                        Severity: Major
                                        Found in src/cs.js and 1 other location - About 3 hrs to fix
                                        src/cs.js on lines 1207..1213

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            var form = document.createElement('form'),
                                                textarea = document.createElement('textarea'),
                                                buttons = document.createElement('div'),
                                                edit = document.createElement('button'),
                                                cancel = document.createElement('button'),
                                        Severity: Major
                                        Found in src/cs.js and 1 other location - About 2 hrs to fix
                                        src/cs.js on lines 725..730

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                var personalInfo = document.getElementById('profile-personalinfo'),
                                                    customFields = document.getElementById('profile-customfields'),
                                                    statistics   = document.getElementById('profile-statistics'),
                                                    contactInfo  = document.getElementById('profile-contactinfo'),
                                                    signature    = document.getElementById('sig_popup'),
                                        Severity: Major
                                        Found in src/cs.js and 1 other location - About 2 hrs to fix
                                        src/cs.js on lines 1457..1462

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

                                        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

                                        $cs.module.Topics.prototype.initialize = function(settings) {
                                            // Call $cs.module.Default's initialize method instead.
                                            $cs.module.Default.prototype.initialize.call(this, settings);
                                        };
                                        Severity: Major
                                        Found in src/cs.js and 2 other locations - About 1 hr to fix
                                        src/cs.js on lines 647..650
                                        src/cs.js on lines 1850..1853

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

                                        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

                                        $cs.module.Profile.prototype.initialize = function(settings) {
                                            // Call $cs.module.Default's initialize method instead.
                                            $cs.module.Default.prototype.initialize.call(this, settings);
                                        };
                                        Severity: Major
                                        Found in src/cs.js and 1 other location - About 1 hr to fix
                                        src/cs.js on lines 319..322

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

                                        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

                                        $cs.module.Index.prototype.initialize = function(settings) {
                                            // Call $cs.module.Default's initialize method instead.
                                            $cs.module.Default.prototype.initialize.call(this, settings);
                                        };
                                        Severity: Major
                                        Found in src/cs.js and 1 other location - About 1 hr to fix
                                        src/cs.js on lines 1040..1043

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

                                        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

                                        $cs.module.Stats.prototype.initialize = function(settings) {
                                            // Call $cs.module.Default's initialize method instead.
                                            $cs.module.Default.prototype.initialize.call(this, settings);
                                        };
                                        Severity: Major
                                        Found in src/cs.js and 2 other locations - About 1 hr to fix
                                        src/cs.js on lines 1282..1285
                                        src/cs.js on lines 1850..1853

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

                                        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

                                        $cs.module.Posts.prototype.initialize = function(settings) {
                                            // Call $cs.module.Default's initialize method instead.
                                            $cs.module.Default.prototype.initialize.call(this, settings);
                                        };
                                        Severity: Major
                                        Found in src/cs.js and 2 other locations - About 1 hr to fix
                                        src/cs.js on lines 647..650
                                        src/cs.js on lines 1282..1285

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

                                        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

                                                request.onreadystatechange = function() {
                                                    if (request.readyState > 3 && callback && typeof(callback) == 'function') {
                                                        callback(request.responseText);
                                                    }
                                                };
                                        Severity: Major
                                        Found in src/cs.js and 1 other location - About 1 hr to fix
                                        src/cs.js on lines 1375..1379

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

                                        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

                                                request.onreadystatechange = function() {
                                                    if (request.readyState > 3 && callback && typeof(callback) == 'function') {
                                                        callback(request.responseText);
                                                    }
                                                };
                                        Severity: Major
                                        Found in src/cs.js and 1 other location - About 1 hr to fix
                                        src/cs.js on lines 1397..1401

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

                                        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 (userPhoto) {
                                                    this.setValue('userPhoto', userPhoto.src);
                                                } else {
                                                    this.setValue('userPhoto', this.config.userPhotoDefault);
                                                }
                                        Severity: Minor
                                        Found in src/cs.js and 1 other location - About 35 mins to fix
                                        src/cs.js on lines 742..746

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

                                        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 (userPhoto) {
                                                    this.setValue('userPhoto', userPhoto.src);
                                                } else {
                                                    this.setValue('userPhoto', this.config.userPhotoDefault);
                                                }
                                        Severity: Minor
                                        Found in src/cs.js and 1 other location - About 35 mins to fix
                                        src/cs.js on lines 872..876

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

                                        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 (postLinks.length > 1) {
                                                        this.setValue('postAuthor', cells[0].innerHTML.split('normalname">')[1].slice(0, -7));
                                                    } else {
                                        Severity: Minor
                                        Found in src/cs.js and 1 other location - About 35 mins to fix
                                        src/cs.js on lines 1749..1751

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

                                        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

                                                    } else {
                                                        this.setValue('postAuthor', cells[0].innerHTML.split('unreg">')[1].slice(0, -7));
                                                    }
                                        Severity: Minor
                                        Found in src/cs.js and 1 other location - About 35 mins to fix
                                        src/cs.js on lines 1747..1749

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

                                        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

                                        There are no issues that match your filters.

                                        Category
                                        Status