Showing 53 of 77 total issues
Function RbutrUtils
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const RbutrUtils = () => {
'use strict';
const devStorageKey = 'rbutr.isDev';
Function refreshSubmissionData
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const refreshSubmissionData = () => {
const HTTP_LENGTH = 4;
if (rbutr.getPropLen('sourceUrls') > ONE) {
Function createMessageTemplate
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createMessageTemplate = ($data, requestedUrl) => {
let
messageTemplate = '',
rbutrLogo = '<img src="' + content.serverDomain + '/images/logohomepagelowres.png" width="24" class="rbutr-logo" alt="Rbutr">',
File md5.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
Function onreadystatechange
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
document.onreadystatechange = () => {
'use strict';
if (document.readyState === 'complete') {
Function Platform
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Platform = () => {
'use strict';
let properties = {
Function Platform
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const Platform = () => {
'use strict';
let properties = {
- 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 getRebuttals
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getRebuttals = (tabId, url) => {
setProp('rebuttals', tabId, null);
let canVote = false;
let recordedClick = getRecordedClickByToUrl(getProp('canonicalUrls', tabId));
Function EventTarget
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var EventTarget = function() {
var eventSplitter = /\s+/;
return {
on: function(events, callback) {
var event;
Function submitRebuttals
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
const submitRebuttals = (tabId) => {
let sourcePageTitles = [];
let rebuttalPageTitles = [];
let canonicalSourcePages = [];
Function initialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function(datasetDefs) {
var datasets;
datasetDefs = utils.isArray(datasetDefs) ? datasetDefs : [ datasetDefs ];
if (datasetDefs.length === 0) {
$.error("no datasets provided");
Function _loadPrefetchData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadPrefetchData: function(o) {
var that = this, thumbprint = VERSION + (o.thumbprint || ""), storedThumbprint, storedProtocol, storedItemHash, storedAdjacencyList, isExpired, deferred;
if (this.storage) {
storedThumbprint = this.storage.get(keys.thumbprint);
storedProtocol = this.storage.get(keys.protocol);
Function rstr2b64
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function rstr2b64(input)
{
try { b64pad } catch(e) { b64pad=''; }
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var output = "";
- 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 View
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const View = () => {
'use strict';
- 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 str2rstr_utf8
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function str2rstr_utf8(input)
{
var output = "";
var i = -1;
var x, y;
- 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 _getLocalSuggestions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getLocalSuggestions: function(terms) {
var that = this, firstChars = [], lists = [], shortestList, suggestions = [];
utils.each(terms, function(i, term) {
var firstChar = term.charAt(0);
!~utils.indexOf(firstChars, firstChar) && firstChars.push(firstChar);
Function setAlertOnPosts
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setAlertOnPosts = () => {
let
index = 0,
itemSelectors = platform.getProp('config').itemSelectors,
Function rstr2any
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function rstr2any(input, encoding)
{
var divisor = encoding.length;
var i, j, q, x, quotient;
Function View
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const View = () => {
'use strict';
Function str2rstr_utf8
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function str2rstr_utf8(input)
{
var output = "";
var i = -1;
var x, y;