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;
File native.history.js
has 1413 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
json2.js
2012-10-08
Public Domain.
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;
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.
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
Function onUnload
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
History.onUnload = function(){
// Prepare
var currentStore, item, currentStoreString;
// Fetch
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'),
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
Function pushState
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
History.pushState = function(data,title,url,queue){
//History.debug('History.pushState: called', arguments);
// We assume that the URL passed in is URI-encoded, but this makes
// sure that it's fully URI encoded; any '%'s that are encoded are
Function parse
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
Function onHashChange
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
History.onHashChange = function(event){
//History.debug('History.onHashChange', arguments);
// Prepare
var currentUrl = ((event && event.newURL) || History.getLocationHref()),
Consider simplifying this complex logical expression. Open
if (History.options.html4Mode) {
History.emulated = {
pushState : true,
hashChange: true
};
Function replaceState
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
History.replaceState = function(data,title,url,queue){
//History.debug('History.replaceState: called', arguments);
// We assume that the URL passed in is URI-encoded, but this makes
// sure that it's fully URI encoded; any '%'s that are encoded are
Function normalizeState
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
History.normalizeState = function(oldState){
// Variables
var newState, dataNotEmpty;
// Prepare
Function checkerFunction
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
History.checkerFunction = function(){
// Check Running
if ( checkerRunning ) {
return false;
}
Avoid deeply nested control flow statements. Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
Avoid deeply nested control flow statements. Open
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
Avoid deeply nested control flow statements. Open
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
Avoid deeply nested control flow statements. Open
if (startedWithHash && iframeHash === '') {
History.back();
}
else {
// Update the Hash
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return doc.URL || doc.location.href;
Similar blocks of code found in 2 locations. Consider refactoring. Open
(function(window,undefined){
"use strict";
// ========================================================================
// Initialise
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
(function(window,undefined){
"use strict";
// ========================================================================
// Initialise
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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.
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
(function(window,undefined){
"use strict";
// Localise Globals
var History = window.History = window.History||{};
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76