Showing 109 of 313 total issues
Function f
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
d3.f = function () {
var functions = arguments
//convert all string arguments into field accessors
var i = 0, l = functions.length
while (i < l) {
Function f
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
d3.f = function () {
var functions = arguments
//convert all string arguments into field accessors
var i = 0, l = functions.length
while (i < l) {
Function sigmoidGraph
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
var sigmoidGraph = function (containerElement, xStart, xEnd, xDefault, sliderElement, sigmoidInputElement,
sigmoidFormulaInputElement, sigmoidResult, sigmoidGraphResult) {
Function reluGraph
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
var reluGraph = function (containerElement, xStart, xEnd, xDefault, sliderElement, reluInputElement,
reluFormulaInputElement, reluResult, reluGraphResult) {
Function removeIndent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected removeIndent(lines: string[]) {
let minIndent = Number.MAX_VALUE;
for (const line of lines) {
if (line.length > 0) {
let i = 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 createReplacer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected async createReplacer(context: HtmlRR0SsgContext): Promise<RegexReplacer> {
return {
replace: (_match: string, ..._args: any[]): string => {
const file = context.file
let authors = file.meta.author
- 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 execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async execute(context: HtmlRR0SsgContext): Promise<void> {
const file = context.file
const inDescription = file.meta.description
const outDoc = file.document
let descriptionMeta = outDoc.head.querySelector("meta[name='description']")
Function process
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected async process(context: HtmlRR0SsgContext, data: RR0Data) {
this.processTitle(context, data)
this.processURL(context, data)
const events = data.events.sort(
(event1, event2) => event1.time ? event2.time ? event1.time.isBefore(event2.time) ? -1 : 1 : -1 : 1)
Function read
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async read(): Promise<T[]> {
if (this.values.length > 0) {
this.logger.warn("Overwriting previously read values", this.values)
}
this.values = []
Function getWeightNodeCoordinates
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function getWeightNodeCoordinates(inputLayerNodeCount,
inputNodeCount, outputNodeCount,
inputLayerCoordinates, weightLayerXCoordinates,
outputLayerCoordinates,
biasLayerX, inputLayerX) {
Consider simplifying this complex logical expression. Open
if (!(globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)) {
const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received."
// Wrapping the bulk of this polyfill in a one-time-use function is a minor
// optimization for Firefox. Since Spidermonkey does not fully parse the
Function gradientDescentStep
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
NN_trainer.prototype.gradientDescentStep = function (number_of_steps) {
// I probably shouldn't do this. I started doing feature normalization so we can keep to one learning rate.
// I decided to do it this way to maintain narrative continuity.
this.learningRate = 0.00000001;
- 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 getSoftmaxtoOutputLinesData
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function getSoftmaxtoOutputLinesData(outputNodeCount, activationLayerX, nodeRadius, outputLayerCoordinates,
outputLayerX, classes) {
Avoid deeply nested control flow statements. Open
for (let i = 0; i < dictWord.length; i++, matchStart++) {
const dictWordChar = dictWord.charAt(i)
const fileWordChar = contents.charAt(pos + matchStart)
if (fileWordChar === badChar) {
score += 5
Avoid deeply nested control flow statements. Open
if (choice.value !== false) {
var knownPhenomenaProbabilities = choice.knownPhenomenaProbabilities
for (var p in knownPhenomenaProbabilities) {
if (knownPhenomenaProbabilities.hasOwnProperty(p)) {
if (!zerosCount[p]) {
Function fileSearchChange
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function fileSearchChange (e) {
tableBody.innerHTML = ""
const input = (fileSearchInput.value || "").toLowerCase().trim()
/**
- 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
Avoid deeply nested control flow statements. Open
if (choice.value !== false) {
var knownPhenomenaProbabilities = choice.knownPhenomenaProbabilities;
for (var p in knownPhenomenaProbabilities) {
if (knownPhenomenaProbabilities.hasOwnProperty(p)) {
if (!zerosCount[p]) {
Function getLayerXScale
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getLayerXScale(numberOfLayers, layersRegionWidth, outputRegionWidth, marginLeft, nodeRadius) {
Function draw
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
draw: function (layer, properties, activeRegionSVGGroup, layerInputs, tooltipDiv) {
Function NN_trainer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var NN_trainer = function (svg_el, table_el, areas, prices, weight, bias, x1, y1, x2, y2,
gradientDescentButton, gradientDescent10Button, gradientDescent100Button,
gradientDescentConvergeButton, normalize, error_chart_el, heatmap_el,
weightRange, biasRange, neuralNetworkGraphEl, analyticsCategory) {
this.svg_el = svg_el;
- 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"