Showing 163 of 559 total issues
File nn_calc.js
has 1464 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function (global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory() :
typeof define === "function" && define.amd ? define(factory) :
(factory())
}(this, (function () {
peopleMessages_fr
has 82 functions (exceeds 20 allowed). Consider refactoring. Open
occupation: {
actor: (gender: Gender) => gender === Gender.male ? "acteur" : "actrice",
anthropologist: (_gender: Gender) => "anthropologue",
archeologist: (_gender: Gender) => "archéologue",
artist: (_gender: Gender) => "artiste",
peopleMessages_en
has 82 functions (exceeds 20 allowed). Consider refactoring. Open
occupation: {
actor: (gender: Gender) => gender === Gender.male ? "actor" : "actress",
anthropologist: (_gender: Gender) => "anthropologist",
archeologist: (_gender: Gender) => "archeologist",
artist: (_gender: Gender) => "artist",
Function build
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
static build(oldContext: RR0SsgContext, newContext: RR0SsgContext): string {
const previousTime = oldContext?.time;
if (!previousTime?.isDefined()) {
return TimeTextBuilder.build(newContext)
}
- 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
File simple_nn.js
has 583 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Created by alammar on 11/16/16.
*/
File shallow_nn_grapher.js
has 442 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Created by alammar on 12/8/16.
*/
var shallowNeuralNetworkGrapher = function (inputNodeCount, outputNodeCount, svgElement, analyticsCategory) {
Function createReplacer
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
protected async createReplacer(context: HtmlRR0SsgContext): Promise<DomReplacer> {
const doc = context.outputFile.document
return new class implements DomReplacer {
async replace(original: HTMLElement): Promise<HTMLElement> {
if (!original.hasChildNodes()) {
- 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 build
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
static build(oldContext: RR0SsgContext, newContext: RR0SsgContext): string {
const previousTime = oldContext?.time;
if (!previousTime?.isDefined()) {
return TimeTextBuilder.build(newContext)
}
File two_variable_nn.js
has 398 lines of code (exceeds 250 allowed). Consider refactoring. Open
var multiVariableNeuralNetworkTrainer = function (numberOfInputNodes,
svg_el, table_el,
dataPoints, labels,
weights, bias,
gradientDescentButton, gradientDescent10Button, gradientDescent100Button,
Function handleInternal
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
protected async handleInternal(context: HtmlRR0SsgContext, a: HTMLAnchorElement, url: URL) {
if (url.protocol.startsWith("http")) {
const pathname = url.pathname
const pathToSearch = pathname.substring(1)
if (pathToSearch && this.caseService.dirs.find(dir => dir.startsWith(pathToSearch))) {
- 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 initializeNeuralNetworkGraph
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
multiVariableNeuralNetworkTrainer.prototype.initializeNeuralNetworkGraph = function () {
this.nnGraphHolder = d3.select(this.neuralNetworkGraphEl) // select the 'body' element
.append("svg") // append an SVG element to the body
.attr("width", this.graphWidth) // make the SVG element 449 pixels wide
.attr("height", 250); // make the SVG element 249 pixels high
Function initializeGraph
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
accuracyGraph.prototype.initializeGraph = function (containerElement, data) {
this.graphHolder = d3.select(this.containerElement) // select the 'body' element
.append("svg")
.attr("class", "accuracy-graph")
Function getPeopleLink
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
static getPeopleLink(context: HtmlRR0SsgContext,
people: KnownPeople, pseudoPeopleList: People[], allCountries: Set<CountryCode>,
occupations: Set<Occupation>, filterOccupations: Occupation[], content?: string): HTMLElement {
const dirName = people.dirName
const titles = []
- 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 import
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
async import(fileName: string) {
const COLUMN_YEAR_PUBLISHED = "Year Published"
const COLUMN_TITLE = "Title"
const COLUMN_PUBLISHER = "Publisher"
const COLUMN_AUTHOR = "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 createReplacer
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected async createReplacer(context: HtmlRR0SsgContext): Promise<DomReplacer<HTMLImageElement>> {
return {
replace: async (imgEl: HTMLImageElement): Promise<HTMLImageElement> => {
const src = imgEl.src;
const imgParentEl = imgEl.parentElement;
- 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 drawGraph
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
shallowNeuralNetworkGrapher.prototype.drawGraph = function () {
var grapher = this;
this.nodeRadius = 15;
this.weightNodeWidthRatio = 1.7;
// Let's calculate our coordinates for all the nodes
Function draw
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function (layer, properties, activeRegionSVGGroup, layerInputs, tooltipDiv) {
console.log("layer", layer)
var data = layer.nodeRenderingDetails,
containerElement = properties.containerElement
Function initializeGraph
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
reluGraph.prototype.initializeGraph = function () {
var obj = this
this.graphHolder = d3.select(this.containerElement) // select the 'body' element
.append("svg") // append an SVG element to the body
.attr("class", "activation-graph")
Function initializeGraph
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
sigmoidGraph.prototype.initializeGraph = function () {
var obj = this;
this.graphHolder = d3.select(this.containerElement) // select the container element
.append("svg") // append an SVG element to the body
.attr("class", "activation-graph")
Function getPeopleLink
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getPeopleLink(context: HtmlRR0SsgContext,
people: KnownPeople, pseudoPeopleList: People[], allCountries: Set<CountryCode>,
occupations: Set<Occupation>, filterOccupations: Occupation[], content?: string): HTMLElement {
const dirName = people.dirName
const titles = []