Showing 549 of 549 total issues
Function DutchStemmer
has 327 lines of code (exceeds 25 allowed). Consider refactoring. Open
st = new function DutchStemmer() {
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
new Among("\u00E4", 0, 1), new Among("\u00E9", 0, 2),
new Among("\u00EB", 0, 2), new Among("\u00ED", 0, 3),
new Among("\u00EF", 0, 3), new Among("\u00F3", 0, 4),
File underscore-1.3.1.js
has 665 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Underscore.js 1.3.1
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
File websupport.js
has 638 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* websupport.js
* ~~~~~~~~~~~~~
*
* sphinx.websupport utilities for all documentation.
Function stemmer
has 276 lines of code (exceeds 25 allowed). Consider refactoring. Open
lunr.ru.stemmer = (function() {
/* create the wrapped stemmer object */
var Among = lunr.stemmerSupport.Among,
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
st = new function RussianStemmer() {
Function stemmer
has 275 lines of code (exceeds 25 allowed). Consider refactoring. Open
lunr.de.stemmer = (function() {
/* create the wrapped stemmer object */
var Among = lunr.stemmerSupport.Among,
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
st = new function GermanStemmer() {
File lunr.fr.js
has 623 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Lunr languages, `French` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
Function RussianStemmer
has 267 lines of code (exceeds 25 allowed). Consider refactoring. Open
st = new function RussianStemmer() {
var a_0 = [new Among("\u0432", -1, 1), new Among("\u0438\u0432", 0, 2),
new Among("\u044B\u0432", 0, 2),
new Among("\u0432\u0448\u0438", -1, 1),
new Among("\u0438\u0432\u0448\u0438", 3, 2),
Function GermanStemmer
has 266 lines of code (exceeds 25 allowed). Consider refactoring. Open
st = new function GermanStemmer() {
var a_0 = [new Among("", -1, 6), new Among("U", 0, 2),
new Among("Y", 0, 1), new Among("\u00E4", 0, 3),
new Among("\u00F6", 0, 4), new Among("\u00FC", 0, 5)
],
Function ajax
has 240 lines of code (exceeds 25 allowed). Consider refactoring. Open
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
Function Stemmer
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
var Stemmer = function() {
var step2list = {
ational: 'ate',
tional: 'tion',
- Read upRead up
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 SnowballProgram
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
SnowballProgram: function() {
var current;
return {
bra : 0,
ket : 0,
File lunr.it.js
has 537 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Lunr languages, `Italian` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
Similar blocks of code found in 2 locations. Consider refactoring. Open
function r_consonant_pair() {
var v_1 = sbp.limit - sbp.cursor,
v_2;
if (sbp.cursor >= I_p1) {
v_2 = sbp.limit_backward;
- 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 208.
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 r_consonant_pair() {
var v_1 = sbp.limit - sbp.cursor,
v_2;
if (sbp.cursor >= I_p1) {
v_2 = sbp.limit_backward;
- 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 208.
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
Function setDocument
has 216 lines of code (exceeds 25 allowed). Consider refactoring. Open
setDocument = Sizzle.setDocument = function( node ) {
var hasCompare,
doc = node ? node.ownerDocument || node : preferredDoc,
parent = doc.defaultView;
File lunr.es.js
has 520 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Lunr languages, `Spanish` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
File lunr.pt.js
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Lunr languages, `Portuguese` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
File lunr.hu.js
has 488 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Lunr languages, `Hungarian` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
File lunr.ro.js
has 479 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Lunr languages, `Romanian` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
File searchtools.js
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* searchtools.js_t
* ~~~~~~~~~~~~~~~~
*
* Sphinx JavaScript utilities for the full-text search.