Fixed some issues reported by SonarQube.

This commit is contained in:
Pradip Parkale 2021-03-19 11:56:12 +05:30 committed by Akshay Joshi
parent f5cc1d1c7e
commit 24dc7f4a91
4 changed files with 11 additions and 22 deletions

View File

@ -367,7 +367,6 @@ define('pgadmin.node.fts_configuration', [
self.$grid.find('.new').removeClass('new');
var newRow = self.grid.body.rows[idx].$el;
newRow.addClass('new');
//$(newRow).pgMakeVisible('table-bordered');
$(newRow).pgMakeVisible('backform-tab');
}

View File

@ -48,13 +48,7 @@ define('pgadmin.node.function', [
id: 'argtype', label: gettext('Data type'), cell:
'node-ajax-options', cellHeaderClasses: 'width_percent_30',
control: 'node-ajax-options', type: 'text', url: 'get_types',
editable: function(m) {
var node_info = this.get('node_info');
if(node_info && 'catalog' in node_info) {
return false;
}
return _.isUndefined(m.isNew) ? true : m.isNew();
}, first_empty: true,
editable: 'isEditable', first_empty: true,
},{
id: 'argmode', label: gettext('Mode'), type: 'options',
control: 'node-ajax-options', cellHeaderClasses:'width_percent_20',
@ -66,13 +60,7 @@ define('pgadmin.node.function', [
{'label': 'OUT', 'value': 'OUT'},
{'label': 'INOUT', 'value': 'INOUT'},
{'label': 'VARIADIC', 'value': 'VARIADIC'},
], editable: function(m) {
var node_info = this.get('node_info');
if(node_info && 'catalog' in node_info) {
return false;
}
return _.isUndefined(m.isNew) ? true : m.isNew();
},
], editable: 'isEditable',
},{
id: 'argname', label: gettext('Argument name'), type: 'text',
cell: 'string', editable: 'isInCatalog', cellHeaderClasses:'width_percent_30',
@ -82,6 +70,13 @@ define('pgadmin.node.function', [
},
],
toJSON: Backbone.Model.prototype.toJSON,
isEditable: function(m) {
var node_info = this.get('node_info');
if(node_info && 'catalog' in node_info) {
return false;
}
return _.isUndefined(m.isNew) ? true : m.isNew();
},
isInCatalog: function(m){
var node_info = this.get('node_info');
if(node_info && 'catalog' in node_info) {

View File

@ -48,12 +48,7 @@ define('pgadmin.node.trigger_function', [
},
hasSQL: true,
showMenu: function(itemData, item) {
let node = pgBrowser.treeMenu.findNodeByDomElement(item);
if (!node || node.parentNode.getData()._type === 'trigger')
return false;
return true;
return this.canEdit(itemData, item);
},
hasDepends: true,
hasStatistics: true,

View File

@ -608,7 +608,7 @@ class Filemanager(object):
created = time.ctime(os.path.getctime(system_path))
modified = time.ctime(os.path.getmtime(system_path))
file_extension = str(splitext(system_path))
except Exception as e:
except Exception:
continue
# set protected to 1 if no write or read permission