Deep Scan Medium Severity

This commit is contained in:
Luis Fernando Molina committed 2020-10-07 23:41:23 +02:00
1 parent 019e5644b7
commit 6eb9f34c22
26 files changed
+111 -125

No files matched your search

+1 -1
View File
@@ -115,7 +115,7 @@ function newAnimation() {
row = 0
for (const [key, timeConsumed] of performanceMap.entries()) {
row++
labelToPrint = key + ' ' + timeConsumed.toFixed(4)
let labelToPrint = key + ' ' + timeConsumed.toFixed(4)
printLabel(labelToPrint, 10, 100 + row * 30, 1, 20, UI_COLOR.RED)
let percentage = timeConsumed * 100 / totalTimeConsumed
labelToPrint = key + ' ' + percentage.toFixed(1) + '%'
+18 -17
View File
@@ -73,29 +73,30 @@ function newCanvas() {
thisObject.floatingSpace.finalize()
thisObject.shorcutNumbers = undefined
browserCanvas.removeEventListener('mousedown', onMouseDown, false)
browserCanvas.removeEventListener('mouseup', onMouseUp, false)
browserCanvas.removeEventListener('mousemove', onMouseMove, false)
browserCanvas.removeEventListener('click', onMouseClick, false)
browserCanvas.removeEventListener('mouseout', onMouseOut, false)
if (browserCanvas.removeEventListener) {
browserCanvas.removeEventListener('mousewheel', onMouseWheel, false)// IE9, Chrome, Safari, Opera
browserCanvas.removeEventListener('DOMMouseScroll', onMouseWheel, false) // Firefox
} else browserCanvas.detachEvent('onmousewheel', onMouseWheel) // IE 6/7/8
browserCanvas.removeEventListener('dragenter', onDragEnter, false)
browserCanvas.removeEventListener('dragleave', onDragLeave, false)
browserCanvas.removeEventListener('dragover', onDragOver, false)
browserCanvas.removeEventListener('drop', onDragDrop, false)
browserCanvas.removeEventListener('keydown', onKeyDown, false)
browserCanvas.removeEventListener('keyup', onKeyUp, false)
browserCanvas.removeEventListener('mousedown', onMouseDown, false)
browserCanvas.removeEventListener('mouseup', onMouseUp, false)
browserCanvas.removeEventListener('mousemove', onMouseMove, false)
browserCanvas.removeEventListener('click', onMouseClick, false)
browserCanvas.removeEventListener('mouseout', onMouseOut, false)
browserCanvas.removeEventListener('dragenter', onDragEnter, false)
browserCanvas.removeEventListener('dragleave', onDragLeave, false)
browserCanvas.removeEventListener('dragover', onDragOver, false)
browserCanvas.removeEventListener('drop', onDragDrop, false)
browserCanvas.removeEventListener('keydown', onKeyDown, false)
browserCanvas.removeEventListener('keyup', onKeyUp, false)
} else {
browserCanvas.detachEvent('onmousewheel', onMouseWheel) // IE 6/7/8
}
thisObject.splashScreen = undefined
lastContainerMouseOver = undefined
hisObject.mouse = undefined
thisObject.mouse = undefined
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] finalize -> err = ' + err.stack) }
}
@@ -544,7 +545,7 @@ function newCanvas() {
} else {
/* After the warning, we allow the key to be re-assigned */
nodeUsingThisKey.payload.uiObject.shortcutKey = ''
nodeUsingThisKey === undefined
nodeUsingThisKey = undefined
nodeOnFocus.payload.uiObject.shortcutKey = event.key
nodeOnFocus.payload.uiObject.valueAtAngle = false
nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + event.key)
+2 -2
View File
@@ -645,8 +645,8 @@ function newTimeMachine() {
}
function drawLabel() {
if (thisObject.payload.node === undefined) { return }
if (thisObject.payload === undefined) { return }
if (thisObject.payload.node === undefined) { return }
/* Draw Title Above the Container */
let position = {
x: 0,
@@ -688,7 +688,7 @@ function newTimeMachine() {
for (let j = 0; j < layers.length; j++) {
let layer = layers[j]
exchangeMarket = {
let exchangeMarket = {
exchangeName: layer.exchange.name,
marketName: layer.market,
exchangeIcon: layer.exchangeIcon,
@@ -331,7 +331,7 @@ function newCryptoEcosystemFunctions() {
Create everything inside the session references.
*/
for (let j = 0; j < marketTradingProducts.sessionReferences.length; j++) {
sessionReference = marketTradingProducts.sessionReferences[j]
let sessionReference = marketTradingProducts.sessionReferences[j]
menuClick(sessionReference, 'Add All Trading Mine Products', true)
menuClickOfNodeArray(sessionReference.tradingMineProducts, 'Add All Data Products', true)
sessionReference.payload.floatingObject.collapseToggle()
@@ -119,8 +119,8 @@ function newNodeDeleter() {
}
function cleanNode(node) {
if (node.payload === undefined) { return }
if (node === undefined) { return }
if (node.payload === undefined) { return }
node.payload.targetPosition.x = undefined
node.payload.targetPosition.y = undefined
@@ -25,8 +25,7 @@ function newOnFocus() {
case 'node': {
if (property.name !== previousPropertyName) {
if (node[property.name] !== undefined) {
let child
child = getNodeThatIsOnFocus(node[property.name])
let child = getNodeThatIsOnFocus(node[property.name])
if (child !== undefined) {
return child
}
@@ -39,7 +38,7 @@ function newOnFocus() {
let nodePropertyArray = node[property.name]
if (nodePropertyArray !== undefined) {
for (let m = 0; m < nodePropertyArray.length; m++) {
child = getNodeThatIsOnFocus(nodePropertyArray[m])
let child = getNodeThatIsOnFocus(nodePropertyArray[m])
if (child !== undefined) {
return child
}
@@ -19,7 +19,7 @@ function newReferenceAttachDetach() {
}
function completeDetachment(node) {
if (node.payload !== undefined !== undefined) {
if (node.payload !== undefined) {
if (node.payload.referenceParent !== undefined) {
if (node.payload.referenceParent.payload !== undefined) {
if (node.payload.referenceParent.payload.uiObject !== undefined) {
@@ -24,8 +24,7 @@ function newShortcutKeys() {
case 'node': {
if (property.name !== previousPropertyName) {
if (node[property.name] !== undefined) {
let child
child = getNodeByShortcutKey(node[property.name], searchingKey)
let child = getNodeByShortcutKey(node[property.name], searchingKey)
if (child !== undefined) {
return child
}
@@ -38,7 +37,7 @@ function newShortcutKeys() {
let nodePropertyArray = node[property.name]
if (nodePropertyArray !== undefined) {
for (let m = 0; m < nodePropertyArray.length; m++) {
child = getNodeByShortcutKey(nodePropertyArray[m], searchingKey)
let child = getNodeByShortcutKey(nodePropertyArray[m], searchingKey)
if (child !== undefined) {
return child
}
@@ -335,6 +335,7 @@ function newUiObjectsFromNodes() {
if (nodeDefinition === undefined) {
console.log('Cannot addUIOBject of ' + type + ' because that type it is not defined at the APP_SCHEMA.')
return
}
if (nodeDefinition.initialValues !== undefined) {
@@ -384,14 +385,12 @@ function newUiObjectsFromNodes() {
}
}
if (nodeDefinition !== undefined) {
if (nodeDefinition.initialValues !== undefined) {
if (nodeDefinition.initialValues.code !== undefined) {
object.code = nodeDefinition.initialValues.code
}
if (nodeDefinition.initialValues.config !== undefined) {
object.config = nodeDefinition.initialValues.config
}
if (nodeDefinition.initialValues !== undefined) {
if (nodeDefinition.initialValues.code !== undefined) {
object.code = nodeDefinition.initialValues.code
}
if (nodeDefinition.initialValues.config !== undefined) {
object.config = nodeDefinition.initialValues.config
}
}
+1 -1
View File
@@ -185,7 +185,7 @@ function newCodeEditor() {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
if (thisObject.currentRadius >= thisObject.targetRadius) {
labelPoint = {
x: iconPosition.x + thisObject.currentRadius + 10,
y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+1 -1
View File
@@ -190,7 +190,7 @@ function newConfigEditor() {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
if (thisObject.currentRadius >= thisObject.targetRadius) {
labelPoint = {
x: iconPosition.x + thisObject.currentRadius + 10,
y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
+1 -1
View File
@@ -184,7 +184,7 @@ function newFormulaEditor() {
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
if (label !== undefined && thisObject.currentRadius >= thisObject.targetRadius) {
if (thisObject.currentRadius >= thisObject.targetRadius) {
labelPoint = {
x: iconPosition.x + thisObject.currentRadius + 10,
y: iconPosition.y + fontSize * FONT_ASPECT_RATIO
-4
View File
@@ -71,10 +71,6 @@ function newPicker() {
isMouseOver = false
}
function getSelected() {
return optionsList[selected]
}
function setSelected(pOptionsList, pCurrent, pParent, pSelected) {
if (pOptionsList !== undefined) {
optionsList = pOptionsList
+52 -51
View File
@@ -580,10 +580,8 @@ function newUiObject() {
let THRESHOLD = 1.15
if (previousDistanceToChainParent !== undefined) {
if (ratio > THRESHOLD) {
canvas.designSpace.workspace.chainDetachNode(thisObject.payload.node)
}
if (ratio > THRESHOLD) {
canvas.designSpace.workspace.chainDetachNode(thisObject.payload.node)
}
}
@@ -675,9 +673,10 @@ function newUiObject() {
function referenceDetachingPhysics() {
if (isDragging !== true) { return }
if (thisObject.payload === undefined) { return }
if (thisObject.payload.floatingObject.isFrozen === true) { return }
if (rightDragging === false) { return }
if (thisObject.payload === undefined) { return }
if (thisObject.payload.referenceParent === undefined) { return }
let distanceToReferenceParent = Math.sqrt(Math.pow(thisObject.payload.position.x - thisObject.payload.referenceParent.payload.position.x, 2) + Math.pow(thisObject.payload.position.y - thisObject.payload.referenceParent.payload.position.y, 2))
@@ -689,14 +688,11 @@ function newUiObject() {
previousDistanceToReferenceParent = distanceToReferenceParent
if (thisObject.isOnFocus !== true) { return }
if (thisObject.payload.referenceParent === undefined) { return }
let THRESHOLD = 1.15
if (previousDistanceToReferenceParent !== undefined) {
if (ratio > THRESHOLD) {
canvas.designSpace.workspace.referenceDetachNode(thisObject.payload.node)
}
if (ratio > THRESHOLD) {
canvas.designSpace.workspace.referenceDetachNode(thisObject.payload.node)
}
}
@@ -1531,6 +1527,16 @@ function newUiObject() {
label = addIndexNumber(label)
if (label !== undefined) {
if (canvas.floatingSpace.inMapMode === true) {
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
if (nodeDefinition !== undefined) {
if (nodeDefinition.isHierarchyHead !== true) {
return
}
}
}
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
@@ -1543,18 +1549,12 @@ function newUiObject() {
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 1
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 1
}
}
if (canvas.floatingSpace.inMapMode === true) {
labelPoint.y = labelPoint.y - 20
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
if (nodeDefinition !== undefined) {
if (nodeDefinition.isHierarchyHead !== true) {
return
}
}
labelPoint.y = position.y + 50 / 2 + lineSeparator * 1
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
@@ -1600,7 +1600,7 @@ function newUiObject() {
position = canvas.floatingSpace.transformPointToMap(position)
}
let radius = thisObject.payload.floatingObject.container.frame.radius
let radius = thisObject.payload.floatingObject.container.frame.radius
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize * 3 / 4
@@ -1661,10 +1661,10 @@ function newUiObject() {
position = canvas.floatingSpace.transformPointToMap(position)
}
let radius = thisObject.payload.floatingObject.container.frame.radius
let radius = thisObject.payload.floatingObject.container.frame.radius
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize
let fontSize = thisObject.payload.floatingObject.currentFontSize
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
@@ -1732,10 +1732,10 @@ function newUiObject() {
position = canvas.floatingSpace.transformPointToMap(position)
}
let radius = thisObject.payload.floatingObject.container.frame.radius
let radius = thisObject.payload.floatingObject.container.frame.radius
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize
let fontSize = thisObject.payload.floatingObject.currentFontSize
let lineSeparator = thisObject.payload.floatingObject.currentFontSize * 1.2
let label
@@ -1744,27 +1744,26 @@ function newUiObject() {
label = Number(currentPercentage).toFixed(0) + '%'
if (label !== undefined) {
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + radius * 2 / 3 + lineSeparator * 4 + 15
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 4
}
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
}
if (thisObject.isOnFocus === true) {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 5,
y: position.y + radius * 2 / 3 + lineSeparator * 4 + 15
}
} else {
labelPoint = {
x: position.x - label.length / 2 * fontSize * FONT_ASPECT_RATIO - 10,
y: position.y + thisObject.payload.floatingObject.currentImageSize / 2 + lineSeparator * 4
}
}
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.TURQUOISE + ', 1)'
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y)
}
}
@@ -1783,7 +1782,7 @@ function newUiObject() {
position = canvas.floatingSpace.transformPointToMap(position)
}
let radius = thisObject.payload.floatingObject.container.frame.radius
let radius = thisObject.payload.floatingObject.container.frame.radius
/* Label Text */
let labelPoint
let fontSize = thisObject.payload.floatingObject.currentFontSize * 6 / 4 / 2
@@ -2174,15 +2173,17 @@ function newUiObject() {
let additionalImageSize = 0
if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 }
let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
if (nodeDefinition === undefined) { return }
if (canvas.floatingSpace.inMapMode === true) {
totalImageSize = canvas.floatingSpace.transformImagesizeToMap(totalImageSize)
let nodeDefinition = getNodeDefinition(thisObject.payload.node)
if (nodeDefinition !== undefined) {
if (nodeDefinition.isHierarchyHead !== true) {
totalImageSize = totalImageSize / 4
}
if (nodeDefinition.isHierarchyHead === true) {
totalImageSize = 50
} else {
totalImageSize = canvas.floatingSpace.transformImagesizeToMap(totalImageSize)
}
}
}
if (thisObject.isShowing === true) {
totalImageSize = 50
-14
View File
@@ -168,20 +168,6 @@ function newUiObjectTitle() {
}
break
}
case 'Use Reference Parent Parent Parent': {
let nodeToUse = thisObject.payload.node.payload.referenceParent
if (nodeToUse !== undefined && nodeToUse.payload !== undefined) {
nodeToUse = thisObject.payload.node.payload.referenceParent.payload.parentNode
if (nodeToUse !== undefined && nodeToUse.payload !== undefined) {
nodeToUse = thisObject.payload.node.payload.referenceParent.payload.parentNode.payload.parentNode
if (nodeToUse !== undefined && nodeToUse.payload !== undefined) {
thisObject.payload.title = thisObject.payload.title + separator + nodeToUse.payload.title
thisObject.payload.node.name = thisObject.payload.node.name + separator + nodeToUse.payload.node.name
}
}
}
break
}
default: {
if (titleReference.indexOf('Use Child @') === 0) {
let propertyName = titleReference.substring(titleReference.indexOf('@') + 1, titleReference.length)
+2 -1
View File
@@ -296,9 +296,10 @@ function newLayer() {
function getIcon(node) {
let nodeDefinition = getNodeDefinition(node)
let iconName
let icon
if (nodeDefinition.alternativeIcons !== undefined) {
for (let i = 0; i < nodeDefinition.alternativeIcons.length; i++) {
alternativeIcon = nodeDefinition.alternativeIcons[i]
let alternativeIcon = nodeDefinition.alternativeIcons[i]
if (alternativeIcon.codeName === node.config.codeName) {
iconName = alternativeIcon.iconName
}
+1 -1
View File
@@ -381,7 +381,7 @@ function newLayersPanel() {
let found = removeFromLocalLayers(layerNode.id)
if (found !== true) {
layer = addLayer(layerNode)
let layer = addLayer(layerNode)
if (layer !== undefined) {
onLayerStatusChanged(layer)
}
+1 -1
View File
@@ -60,7 +60,7 @@ function newPanelsVisibleButton() {
function setPanelVisibility() {
for (let i = 0; i < thisObject.panels.length; i++) {
panel = canvas.panelsSpace.getPanel(thisObject.panels[i])
let panel = canvas.panelsSpace.getPanel(thisObject.panels[i])
panel.isVisible = thisObject.showPanels
}
}
+1 -1
View File
@@ -891,7 +891,7 @@ function newPlotter() {
}
}
if (coordinateSystem.autoMinYScale === true || coordinateSystem.autoMinYScale === true) {
if (coordinateSystem.autoMinYScale === true || coordinateSystem.autoMaxYScale === true) {
mustRecalculateDataPoints = true
} else {
mustRecalculateDataPoints = false
-1
View File
@@ -115,7 +115,6 @@ function newRecordValues() {
function applyValue(node, value, minDecimals) {
if (canvas.chartingSpace.visible !== true) { return }
if (node === undefined) { return }
if (node === undefined) { return }
if (node.payload === undefined) { return }
if (node.payload.uiObject === undefined) { return }
if (value === true) { value = 'true' }
+5
View File
@@ -176,6 +176,11 @@ function newRateScale() {
return
}
} else {
if (event.shiftKey === true) {
sensitivity = 20
} else {
sensitivity = 5
}
if (wheelDeltaDirection === 1) {
wheelDeltaCounter++
if (wheelDeltaCounter < sensitivity) {
+5
View File
@@ -261,6 +261,11 @@ function newTimeFrameScale() {
return
}
} else {
if (event.shiftKey === true) {
sensitivity = 20
} else {
sensitivity = 5
}
if (wheelDeltaDirection === 1) {
wheelDeltaCounter++
if (wheelDeltaCounter < sensitivity) {
+5
View File
@@ -127,6 +127,11 @@ function newTimeScale() {
return
}
} else {
if (event.shiftKey === true) {
sensitivity = 20
} else {
sensitivity = 5
}
if (wheelDeltaDirection === 1) {
wheelDeltaCounter++
if (wheelDeltaCounter < sensitivity) {
-2
View File
@@ -182,8 +182,6 @@ function newListView() {
function physics() {
if (isInitialized === false || thisObject.isVisible === false) { return }
if (isInitialized === false) { return }
if (thisObject.isVisible === false) { return }
childrenPhysics()
}
-8
View File
@@ -191,14 +191,6 @@ function newTutorialSpace() {
}
}
function checkViewportZoomAtCenter() {
if (currentNode === undefined) { return }
let config = JSON.parse(currentNode.config)
if (config.viewportZoomAtCenter !== undefined) {
canvas.chartingSpace.viewport.zoomAtCenter(config.viewportZoomAtCenter)
}
}
function checkPressButton() {
if (currentNode === undefined) { return }
let config = JSON.parse(currentNode.config)
+1 -1
View File
@@ -63,7 +63,7 @@ function newVideoRecorder() {
let key = canvas.mouse.event.key
if (key === undefined) { break }
switch (key.toLowerCase()) {
case 'Escape':
case 'escape':
{
pointerIcon = canvas.designSpace.iconCollection.get('key-m')
break