File captcha.js
has 707 lines of code (exceeds 250 allowed). Consider refactoring. Open
var keys = {
"0": [
["0", "0", "0", "1", "1", "1", "1", "0", "0", "0"],
["0", "1", "1", "1", "1", "1", "1", "1", "1", "0"],
["0", "1", "1", "1", "0", "0", "0", "1", "1", "0"],
Function getCaptcha
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
var getCaptcha = function(img) {
temp = 0;
var x, y;
for (x = 0; x < 25; ++x) {
- 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 matchImg
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function matchImg(rx, ry, pix, mask) {
flag = 1;
breakflag = 0;
x = 0;
y = 0;
- 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 getCaptcha
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getCaptcha = function(img) {
temp = 0;
var x, y;
for (x = 0; x < 25; ++x) {
Function matchImg
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matchImg(rx, ry, pix, mask) {
flag = 1;
breakflag = 0;
x = 0;
y = 0;
Avoid deeply nested control flow statements. Open
if (matchImg(x, y, img, mask)) {
skipstart.push(y);
skipend.push(y + mask[0].length);
sorter.push(y);
captcha.push(order[l]);
Function sort
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function sort(sorter, captcha) {
for (var i = 0; i < sorter.length; ++i) {
less = sorter[i];
swap = 0;
ls = i;
- 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 getPixelMapFromImageData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var getPixelMapFromImageData = function(imgData) {
var pixMap=[];
var count=0;
var temp=[];
for (var i=0;i<imgData.data.length;i+=4)
- 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"