meteor/meteor

View on GitHub
packages/deprecated/jquery-history/history.js

Summary

Maintainability
F
1 wk
Test Coverage

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

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

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

    /**
     * History.js Core
     * @author Benjamin Arthur Lupton <contact@balupton.com>
     * @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
     * @license New BSD License <http://creativecommons.org/licenses/BSD/>
    Severity: Major
    Found in packages/deprecated/jquery-history/history.js - About 2 days to fix

      Function log has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              History.log = function(){
                  // Prepare
                  var
                      consoleExists = !(typeof console === 'undefined' || typeof console.log === 'undefined' || typeof console.log.apply === 'undefined'),
                      textarea = document.getElementById('log'),
      Severity: Minor
      Found in packages/deprecated/jquery-history/history.js - About 1 hr to fix

        Function onPopState has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    History.onPopState = function(event,extra){
                        // Prepare
                        var stateId = false, newState = false, currentHash, currentState;
        
                        // Reset the double check
        Severity: Minor
        Found in packages/deprecated/jquery-history/history.js - About 1 hr to fix

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

                      History.onUnload = function(){
                          // Prepare
                          var    currentStore, item;
          
                          // Fetch
          Severity: Minor
          Found in packages/deprecated/jquery-history/history.js - About 1 hr to fix

            Function normalizeState has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    History.normalizeState = function(oldState){
                        // Variables
                        var newState, dataNotEmpty;
            
                        // Prepare
            Severity: Minor
            Found in packages/deprecated/jquery-history/history.js - About 1 hr to fix

              Function setHash has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      History.setHash = function(hash,queue){
                          // Prepare
                          var adjustedHash, State, pageUrl;
              
                          // Handle Queueing
              Severity: Minor
              Found in packages/deprecated/jquery-history/history.js - About 1 hr to fix

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

                            History.replaceState = function(data,title,url,queue){
                                //History.debug('History.replaceState: called', arguments);
                
                                // Check the State
                                if ( History.getHashByUrl(url) && History.emulated.pushState ) {
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 1 day to fix
                packages/deprecated/jquery-history/history.js on lines 1698..1744

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

                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

                            History.pushState = function(data,title,url,queue){
                                //History.debug('History.pushState: called', arguments);
                
                                // Check the State
                                if ( History.getHashByUrl(url) && History.emulated.pushState ) {
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 1 day to fix
                packages/deprecated/jquery-history/history.js on lines 1755..1801

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

                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

                        History.getStateByIndex = function(index){
                            // Prepare
                            var State = null;
                
                            // Handle
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 5 hrs to fix
                packages/deprecated/jquery-history/history.html4.js on lines 106..126

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

                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

                        History.getStateId = function(passedState){
                            // Prepare
                            var State, id;
                            
                            // Fetch
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 1 hr to fix
                packages/deprecated/jquery-history/history.js on lines 807..819

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

                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

                        History.getHashByState = function(passedState){
                            // Prepare
                            var State, hash;
                            
                            // Fetch
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 1 hr to fix
                packages/deprecated/jquery-history/history.js on lines 787..799

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

                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 ( queue !== false && History.busy() ) {
                                // Wait + Push to Queue
                                //History.debug('History.back: we must wait', arguments);
                                History.pushQueue({
                                    scope: History,
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 1 hr to fix
                packages/deprecated/jquery-history/history.js on lines 1524..1534

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

                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 ( queue !== false && History.busy() ) {
                                // Wait + Push to Queue
                                //History.debug('History.forward: we must wait', arguments);
                                History.pushQueue({
                                    scope: History,
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 1 hr to fix
                packages/deprecated/jquery-history/history.js on lines 1488..1498

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

                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 ( typeof History.initCore.initialized !== 'undefined' ) {
                            // Already Loaded
                            return false;
                        }
                        else {
                Severity: Minor
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 50 mins to fix
                packages/deprecated/jquery-history/history.html4.js on lines 35..41

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

                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

                                for ( item in History.urlToId ) {
                                    if ( !History.urlToId.hasOwnProperty(item) ) {
                                        continue;
                                    }
                                    currentStore.urlToId[item] = History.urlToId[item];
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 2 other locations - About 40 mins to fix
                packages/deprecated/jquery-history/history.js on lines 1864..1869
                packages/deprecated/jquery-history/history.js on lines 1876..1881

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

                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

                                for ( item in History.idToState ) {
                                    if ( !History.idToState.hasOwnProperty(item) ) {
                                        continue;
                                    }
                                    currentStore.idToState[item] = History.idToState[item];
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 2 other locations - About 40 mins to fix
                packages/deprecated/jquery-history/history.js on lines 1870..1875
                packages/deprecated/jquery-history/history.js on lines 1876..1881

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

                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

                                for ( item in History.stateToId ) {
                                    if ( !History.stateToId.hasOwnProperty(item) ) {
                                        continue;
                                    }
                                    currentStore.stateToId[item] = History.stateToId[item];
                Severity: Major
                Found in packages/deprecated/jquery-history/history.js and 2 other locations - About 40 mins to fix
                packages/deprecated/jquery-history/history.js on lines 1864..1869
                packages/deprecated/jquery-history/history.js on lines 1870..1875

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

                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

                            setHash: Boolean(!History.emulated.pushState && navigator.vendor === 'Apple Computer, Inc.' && /AppleWebKit\/5([0-2]|3[0-3])/.test(navigator.userAgent)),
                Severity: Minor
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 40 mins to fix
                packages/deprecated/jquery-history/history.js on lines 305..305

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

                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

                            safariPoll: Boolean(!History.emulated.pushState && navigator.vendor === 'Apple Computer, Inc.' && /AppleWebKit\/5([0-2]|3[0-3])/.test(navigator.userAgent)),
                Severity: Minor
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 40 mins to fix
                packages/deprecated/jquery-history/history.js on lines 299..299

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

                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

                        History.getLastStoredState = function(){
                            return History.storedStates[History.storedStates.length-1]||undefined;
                        };
                Severity: Minor
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 35 mins to fix
                packages/deprecated/jquery-history/history.js on lines 909..911

                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

                        History.getLastSavedState = function(){
                            return History.savedStates[History.savedStates.length-1]||undefined;
                        };
                Severity: Minor
                Found in packages/deprecated/jquery-history/history.js and 1 other location - About 35 mins to fix
                packages/deprecated/jquery-history/history.js on lines 918..920

                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

                There are no issues that match your filters.

                Category
                Status