Fixed following code smells reported by SonarQube:

1) Remove this redundant jump.
 2) Remove this commented out code.
 3) Variables should not be shadowed.
This commit is contained in:
Akshay Joshi
2022-01-21 18:53:48 +05:30
parent 12d6271b13
commit 343c3ee49c
50 changed files with 130 additions and 161 deletions

View File

@@ -136,7 +136,6 @@ describe('preferences related functions test', function() {
/* Tests */
expect(pgBrowser.editor.getWrapperElement).toHaveBeenCalled();
//expect($.fn.css).toHaveBeenCalledWith('font-size', '1.46em');
let setOptionCalls = pgBrowser.editor.setOption.calls;
expect(setOptionCalls.count()).toEqual(Object.keys(editorOptions).length);

View File

@@ -52,7 +52,7 @@ describe('ImportExportServers', () => {
});
it('export', () => {
let schemaObj = new ImportExportSelectionSchema(
schemaObj = new ImportExportSelectionSchema(
{imp_exp: 'e', filename: 'test.json'});
mount(<SchemaView
formType='dialog'

View File

@@ -136,7 +136,7 @@ describe('IndexSchema', ()=>{
columnSchemaObj.op_class_types = [];
options.push({label: '', value: ''});
status = columnSchemaObj.setOpClassTypes(options);
columnSchemaObj.setOpClassTypes(options);
expect(columnSchemaObj.op_class_types.length).toBe(1);
});
});

View File

@@ -14,7 +14,6 @@ import { createMount } from '@material-ui/core/test-utils';
import pgAdmin from 'sources/pgadmin';
import {messages} from '../fake_messages';
import SchemaView from '../../../pgadmin/static/js/SchemaView';
//import BaseUISchema from 'sources/SchemaView/base_schema.ui';
import RowSecurityPolicySchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.ui';

View File

@@ -14,7 +14,6 @@ import { createMount } from '@material-ui/core/test-utils';
import pgAdmin from 'sources/pgadmin';
import {messages} from '../fake_messages';
import SchemaView from '../../../pgadmin/static/js/SchemaView';
//import BaseUISchema from 'sources/SchemaView/base_schema.ui';
import TriggerSchema, { EventSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.ui';
describe('TriggerSchema', ()=>{

View File

@@ -25,7 +25,6 @@ describe('ExecuteQuery', () => {
const startTime = new Date(2018, 1, 29, 12, 15, 52);
beforeEach(() => {
networkMock = new MockAdapter(axios);
// jasmine.addMatchers({jQuerytoHaveBeenCalledWith: jQuerytoHaveBeenCalledWith});
userManagementMock = jasmine.createSpyObj('UserManagement', [
'isPgaLoginRequired',
'pgaLogin',

View File

@@ -62,7 +62,6 @@ describe('queryToolActions', () => {
it('calls the execute function', () => {
queryToolActions.explainAnalyze(sqlEditorController);
// let explainAnalyzeQuery = 'EXPLAIN (FORMAT JSON, ANALYZE ON, VERBOSE OFF, COSTS OFF, BUFFERS OFF, TIMING OFF) ';
const explainObject = {
format: 'json',
analyze: true,