mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-09 23:54:09 -06:00
e3807ec3d6
1) Boolean checks should not be inverted. 2) Review this redundant assignment. 3) Extract this nested ternary operation into an independent statement. 4) Unexpected empty function. 5) Immediately return this expression instead of assigning it to the temporary variable.
48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
JavaScript
import _ from 'lodash';
|
|
|
|
export class FakeNode {
|
|
constructor(data, id='nid1') {
|
|
this.data = data || {};
|
|
this.id = id;
|
|
}
|
|
setSelected() {/*This is intentional (SonarQube)*/}
|
|
getColumns() {return this.data.columns;}
|
|
getID() {return this.id;}
|
|
setData(data) {this.data = data;}
|
|
getData() {return this.data;}
|
|
getPosition() {return {x: 30, y: 30};}
|
|
setPosition() {/*This is intentional (SonarQube)*/}
|
|
serializeData() {return this.getData();}
|
|
getPortName(attnum) {return `port-${attnum}`;}
|
|
getPort() {return null;}
|
|
addPort(obj) {return obj;}
|
|
getColumnAt(pos) {return _.find(this.getColumns()||[], (c)=>c.attnum==pos);}
|
|
remove() {/*This is intentional (SonarQube)*/}
|
|
getSchemaTableName() {return [this.data.schema, this.data.name];}
|
|
cloneData(tabName) {
|
|
let retVal = {...this.data};
|
|
retVal.name = tabName;
|
|
return retVal;
|
|
}
|
|
getMetadata() {
|
|
return {
|
|
is_promise: false,
|
|
};
|
|
}
|
|
}
|
|
|
|
export class FakeLink {
|
|
constructor(data, id='lid1') {
|
|
this.data = data;
|
|
this.id = id;
|
|
}
|
|
setSelected() {/*This is intentional (SonarQube)*/}
|
|
getID() {return this.id;}
|
|
getData() {return this.data;}
|
|
getSourcePort() {return {remove: ()=>{/*This is intentional (SonarQube)*/}};}
|
|
setSourcePort() {/*This is intentional (SonarQube)*/}
|
|
getTargetPort() {return {remove: ()=>{/*This is intentional (SonarQube)*/}};}
|
|
setTargetPort() {/*This is intentional (SonarQube)*/}
|
|
remove() {/*This is intentional (SonarQube)*/}
|
|
}
|