Fixed following SonarQube code smells:

1) Remove this useless assignment to a variable.
2) Remove the unused local variable.
This commit is contained in:
Akshay Joshi
2022-01-12 14:53:19 +05:30
parent 374c5e952f
commit e38c38cd58
17 changed files with 30 additions and 42 deletions

View File

@@ -52,7 +52,7 @@ class ERDTables(BaseTestGenerator):
tables_utils.create_table(self.server, self.db_name, tab[0],
tab[1])
connection.close()
except Exception as _:
except Exception:
self.dropDB()
raise

View File

@@ -174,7 +174,7 @@ def load_servers():
for item in groups:
all_servers.append(groups[item])
except Exception as e:
except Exception:
return internal_server_error(
_('Unable to load the specified file.'))
else:

View File

@@ -492,7 +492,7 @@ def socket_input(data):
enter_key_press(data)
else:
other_key_press(data)
except Exception as e:
except Exception:
# Delete socket id from sessions.
# request.sid: refer request.sid as socket id.
sio.emit('pty-output',

View File

@@ -765,7 +765,6 @@ define('tools.querytool', [
/* If sql editor is in a new tab, event fired is not available
* instead, a poller is set up who will check
*/
//var browser_qt_preferences = pgBrowser.get_preferences_for_module('browser');
var open_new_tab_qt = self.browser_preferences.new_browser_tab_open;
if(open_new_tab_qt && open_new_tab_qt.includes('qt')) {
pgBrowser.bind_beforeunload();
@@ -2010,7 +2009,7 @@ define('tools.querytool', [
method: 'DELETE',
contentType: 'application/json',
})
.done(function() {})
.done(function() { /* This is intentional */ })
.fail(function() {
/* history clear fail should not affect query tool */
});
@@ -2437,7 +2436,7 @@ define('tools.querytool', [
},
};
},
build:function() {},
build:function() {/* */},
settings:{
message: null,
},
@@ -2517,7 +2516,7 @@ define('tools.querytool', [
function() {
self.initTransaction();
},
function(error) {
function() {
pgBrowser.Events.trigger(
'pgadmin:query_tool:connected_fail:' + self.transId, xhr, error
);
@@ -3430,8 +3429,8 @@ define('tools.querytool', [
contentType: 'application/json',
data: JSON.stringify(history_entry),
})
.done(function() {})
.fail(function() {});
.done(function() { /* This is intentional */ })
.fail(function() { /* This is intentional */ });
self.gridView.history_collection.add(history_entry);
},
@@ -5159,7 +5158,7 @@ define('tools.querytool', [
if(data.data_obj.db_id == db_did && !_.isEqual(db_name, data.data_obj.db_name)) {
var message = `Current database has been moved or renamed to ${data.data_obj.db_name}. Click on the OK button to refresh the database name.`,
title = self.url_params.title;
title = '';
if(self.is_query_tool) {// for query tool

View File

@@ -271,7 +271,7 @@ def save_changed_data(changed_data, columns_info, conn, command_obj,
else:
status, res = conn.execute_void(
item['sql'], item['data'])
except Exception as _:
except Exception:
failure_handle(res, item.get('row_id', 0))
raise