igor-alexandrov/wiselinks

View on GitHub

Showing 73 of 73 total issues

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

(function(window,undefined){
    "use strict";

    // ========================================================================
    // Initialise
Severity: Major
Found in lib/assets/javascripts/lib/native.history.js and 1 other location - About 2 mos to fix
build/wiselinks-1.2.2.js on lines 1973..4011

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

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(window,undefined){
    "use strict";

    // ========================================================================
    // Initialise
Severity: Major
Found in build/wiselinks-1.2.2.js and 1 other location - About 2 mos to fix
lib/assets/javascripts/lib/native.history.js on lines 1299..3337

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

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(window,undefined){
    "use strict";

    // ========================================================================
    // Initialise
Severity: Major
Found in lib/assets/javascripts/lib/native.history.js and 1 other location - About 2 wks to fix
build/wiselinks-1.2.2.js on lines 1289..1965

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

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(window,undefined){
    "use strict";

    // ========================================================================
    // Initialise
Severity: Major
Found in build/wiselinks-1.2.2.js and 1 other location - About 2 wks to fix
lib/assets/javascripts/lib/native.history.js on lines 615..1291

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

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 () {
    'use strict';

    function f(n) {
        // Format integers to have at least two digits.
Severity: Major
Found in lib/assets/javascripts/lib/native.history.js and 1 other location - About 1 wk to fix
build/wiselinks-1.2.2.js on lines 840..1160

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

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 () {
    'use strict';

    function f(n) {
        // Format integers to have at least two digits.
Severity: Major
Found in build/wiselinks-1.2.2.js and 1 other location - About 1 wk to fix
lib/assets/javascripts/lib/native.history.js on lines 166..486

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

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

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

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

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

Refactorings

Further Reading

File wiselinks-1.2.2.js has 1978 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Wiselinks-1.2.2
 * @copyright 2012-2014 Igor Alexandrov, Alexey Solilin, Julia Egorova, Alexandr Borisov
 * @preserve https://github.com/igor-alexandrov/wiselinks
 */
Severity: Major
Found in build/wiselinks-1.2.2.js - About 5 days to fix

    Function initCore has 855 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        History.initCore = function(options){
            // Initialise
            if ( typeof History.initCore.initialized !== 'undefined' ) {
                // Already Loaded
                return false;
    Severity: Major
    Found in build/wiselinks-1.2.2.js - About 4 days to fix

      Function initCore has 855 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          History.initCore = function(options){
              // Initialise
              if ( typeof History.initCore.initialized !== 'undefined' ) {
                  // Already Loaded
                  return false;
      Severity: Major
      Found in lib/assets/javascripts/lib/native.history.js - About 4 days to fix

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

        (function(window,undefined){
            "use strict";
        
            // Localise Globals
            var History = window.History = window.History||{};
        Severity: Major
        Found in lib/assets/javascripts/lib/native.history.js and 1 other location - About 4 days to fix
        build/wiselinks-1.2.2.js on lines 1168..1280

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

        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(window,undefined){
            "use strict";
        
            // Localise Globals
            var History = window.History = window.History||{};
        Severity: Major
        Found in build/wiselinks-1.2.2.js and 1 other location - About 4 days to fix
        lib/assets/javascripts/lib/native.history.js on lines 494..606

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

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

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

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

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

        Refactorings

        Further Reading

        File native.history.js has 1413 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
            json2.js
            2012-10-08
        
            Public Domain.
        Severity: Major
        Found in lib/assets/javascripts/lib/native.history.js - About 3 days to fix

          Function initHtml4 has 261 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              History.initHtml4 = function(){
                  // Initialise
                  if ( typeof History.initHtml4.initialized !== 'undefined' ) {
                      // Already Loaded
                      return false;
          Severity: Major
          Found in build/wiselinks-1.2.2.js - About 1 day to fix

            Function initHtml4 has 261 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                History.initHtml4 = function(){
                    // Initialise
                    if ( typeof History.initHtml4.initialized !== 'undefined' ) {
                        // Already Loaded
                        return false;
            Severity: Major
            Found in lib/assets/javascripts/lib/native.history.js - About 1 day to fix

              Function str has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function str(key, holder) {
              
              // Produce a string from holder[key].
              
                      var i,          // The loop counter.
              Severity: Major
              Found in lib/assets/javascripts/lib/native.history.js - About 2 hrs to fix

                Function str has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function str(key, holder) {
                
                // Produce a string from holder[key].
                
                        var i,          // The loop counter.
                Severity: Major
                Found in build/wiselinks-1.2.2.js - About 2 hrs to fix

                  Function hashChangeInit has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              History.hashChangeInit = function(){
                                  // Define our Checker Function
                                  History.checkerFunction = null;
                  
                                  // Define some variables that will help in our checker function
                  Severity: Major
                  Found in build/wiselinks-1.2.2.js - About 2 hrs to fix

                    Function hashChangeInit has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                History.hashChangeInit = function(){
                                    // Define our Checker Function
                                    History.checkerFunction = null;
                    
                                    // Define some variables that will help in our checker function
                    Severity: Major
                    Found in lib/assets/javascripts/lib/native.history.js - About 2 hrs to fix

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

                          Response.prototype._extract_link_rel_next = function() {
                            if (this._is_full_document_response()) {
                              return $('link[rel="next"]', this._get_doc()).text();
                            } else {
                              return this.xhr.getResponseHeader('X-Wiselinks-LinkRelNext');
                      Severity: Major
                      Found in build/wiselinks-1.2.2.js and 5 other locations - About 2 hrs to fix
                      build/wiselinks-1.2.2.js on lines 522..528
                      build/wiselinks-1.2.2.js on lines 534..540
                      build/wiselinks-1.2.2.js on lines 546..552
                      build/wiselinks-1.2.2.js on lines 558..564
                      build/wiselinks-1.2.2.js on lines 570..576

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

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

                          Response.prototype._extract_title = function() {
                            if (this._is_full_document_response()) {
                              return $('title', this._get_doc()).text();
                            } else {
                              return this.xhr.getResponseHeader('X-Wiselinks-Title');
                      Severity: Major
                      Found in build/wiselinks-1.2.2.js and 5 other locations - About 2 hrs to fix
                      build/wiselinks-1.2.2.js on lines 534..540
                      build/wiselinks-1.2.2.js on lines 546..552
                      build/wiselinks-1.2.2.js on lines 558..564
                      build/wiselinks-1.2.2.js on lines 570..576
                      build/wiselinks-1.2.2.js on lines 582..588

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

                      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