Showing 166 of 560 total issues
Function neuralNetworkCalculationViz
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
var neuralNetworkCalculationViz = function (inputs, inputNodeCount, outputNodeCount, activation, containerElement, weights, biases, tableElement,
trainingSet, classes) {
this.properties = {
Function initializeGraph
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
NN_trainer.prototype.initializeGraph = function () {
this.holder = d3.select(this.svg_el) // 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", 249); // make the SVG element 249 pixels high
Function graphInputToBiasLines
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function graphInputToBiasLines(data) {
var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .input-to-bias-line")
.data(data)
Function graphWeightNodes
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
shallowNeuralNetworkGrapher.prototype.graphWeightNodes = function (data) {
var radius = this.nodeRadius * 0.6;
var t = d3.transition()
.duration(750);
Function fromInternalLink
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected async fromInternalLink(href: string, context: HtmlRR0SsgContext): Promise<Source> {
if (path.dirname(href).startsWith("/")) {
href = href.substring(1)
}
const hashPos = href.lastIndexOf("#")
Function gradientDescentStep
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
multiVariableNeuralNetworkTrainer.prototype.gradientDescentStep = function (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.weightLearningRates = [0.00000001, 0.01];
Function activate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
var activate = function (d) {
if (viz.layerValues[1]) {
// Set up the tooltip to show the inputs and their sum
var rows = "<table class=\"softmax-calculation\">", total = 0
rows = rows + "<tr>" +
Function execute
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
execute(matchCriteria, firstIndex, maxCount, format = true, allowEmpty = true) {
return __awaiter(this, void 0, void 0, function* () {
this.logger.logVerbose(`Querying...`)
const processingStart = Date.now()
const recordEnumerator = this.input.recordEnumerator(firstIndex, maxCount)
Function getWeightNodeCoordinates
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getWeightNodeCoordinates(inputLayerNodeCount,
inputNodeCount, outputNodeCount,
inputLayerCoordinates, weightLayerXCoordinates,
outputLayerCoordinates,
biasLayerX, inputLayerX) {
Function createFromData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
createFromData(context: RR0SsgContext, dirName: string, data: People): People {
const people = this.createFromDirName(dirName)
const title = data.title
if (title) {
try {
- 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 getInfoStr
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getInfoStr(context: HtmlRR0SsgContext) {
const authors = context.inputFile.meta.author
const authorsStr = authors && authors.length > 0 ? authors.join(" & ") : ""
let timeStr = ""
- 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 getWitnesses
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getWitnesses(witnessesStr: string): UrecatWitness[] {
let lastName = ""
const andNames = witnessesStr
.split(" et ")
.flatMap(and => and.split(","))
- 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 aggregate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected async aggregate(context: HtmlRR0SsgContext, element: HTMLUListElement) {
const existingItems = Array.from(element.children)
// TODO: Get cases from local RR0, not the remote one
const existingCases = this.rr0Datasource.getFromRows(context, existingItems)
const casesToAdd: RR0CaseSummary[] = []
- 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 update
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
async update(parent?: Chapter) {
const file = this.context.outputFile;
const meta = file.meta;
const links = file.links;
if (parent) {
Function graphBiasToSoftmaxArrows
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
shallowNeuralNetworkGrapher.prototype.graphBiasToSoftmaxArrows = function (data) {
var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .bias-to-softmax-line")
.data(data);
inputToBiasLines.exit()
Function graphBiasToSoftmaxArrows
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function graphBiasToSoftmaxArrows(data) {
var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .bias-to-softmax-line")
.data(data)
Function graphSoftmaxOutputs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function graphSoftmaxOutputs(softmaxOutputs) {
var grapher = this
var data = []
for (var i = 0; i < this.softmaxOutputs.length; i++) {
data.push({
Function createFromData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
createFromData(context: RR0SsgContext, dirName: string, data: People): People {
const people = this.createFromDirName(dirName)
const title = data.title
if (title) {
try {
Function parse
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse(context: RR0SsgContext, data: string): S[] {
let eol = data.indexOf("\n")
const header = data.substring(0, eol)
data = data.substring(eol + 1).replaceAll(`""`, "''")
this.fields.clear()
Function graphInputToBiasLines
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
shallowNeuralNetworkGrapher.prototype.graphInputToBiasLines = function (data) {
var inputToBiasLines = this.neuralNetworkG.selectAll(this.svgElement + " .input-to-bias-line")
.data(data);
inputToBiasLines.exit()