Skip to content

Commit 3ff3dc2

Browse files
authored
Merge pull request #142 from openxc/sonar-qube-flags
Resolve SonarQube Red Flag Issues (1/2)
2 parents a1f618c + f85c07a commit 3ff3dc2

5 files changed

Lines changed: 12 additions & 22 deletions

File tree

docs/_static/rtd.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,6 @@ div.sphinxsidebar p a:hover {
382382
border: 1px solid #888;
383383
}
384384

385-
/* Tweak any link appearing in a heading */
386-
div.sphinxsidebar h3 a {
387-
}
388-
389-
390-
391385

392386
/* OTHER STUFF ------------------------------------------------------------ */
393387

openxc/formats/binary.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def deserialize(cls, data):
6868
except UnicodeDecodeError as e:
6969
LOG.warn("Unable to parse protobuf: %s", e)
7070
else:
71-
#return type(cls._protobuf_to_dict(message)['payload'])
7271
return cls._protobuf_to_dict(message)
7372

7473
@classmethod

openxc/tools/diagnostics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def diagnostic_request(arguments, controller):
4949
# Stripping all of the unnesseary data we get after sending a diag request in python
5050
# Just like in enabler, it's a diag response if it contains the keys "mode", "bus",
5151
# "id", and "success".
52-
diagMsgReqKeys = ['mode', 'bus', 'id', 'success']
53-
indices = [i for i, s in enumerate(response) if all(x in s for x in diagMsgReqKeys)]
52+
diag_mgs_req_keys = ['mode', 'bus', 'id', 'success']
53+
indices = [i for i, s in enumerate(response) if all(x in s for x in diag_mgs_req_keys)]
5454
if indices:
5555
print(("Response: %s" % response[indices[0]]))
5656
else:

openxc/tools/static/css/dashboard.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ caption {
3737
table, th, td {
3838
text-align: left;
3939
border-spacing: 8px 1px;
40+
border: 1px solid black;
4041
}
4142

4243
.metric {
@@ -48,10 +49,6 @@ th:hover {
4849
background-color: #AAA;
4950
}
5051

51-
table, th, td {
52-
border: 1px solid black;
53-
}
54-
5552
table {
5653
padding-top: 2%;
5754
padding-bottom: 2%;

openxc/tools/static/js/dashboard.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ let recentlyChangedHighlightDuration;
66
let diagnosticCount = 0;
77
/* --- End dashboard parameters --- */
88

9+
var valueChangedTimer;
10+
var valueRecentlyChangedTimer;
11+
912
$(document).ready(function() {
1013
updateDashboardParameters();
1114
searchTable()
@@ -34,7 +37,7 @@ $(document).ready(function() {
3437
});
3538

3639

37-
namespace = '';
40+
var namespace = '';
3841
var socket = io(namespace);
3942
socket.on('vehicle data', function(msg, cb) {
4043
// console.log(msg);
@@ -90,12 +93,9 @@ function saveSettings(e) {
9093
}
9194

9295
function addToDisplay(msgName) {
93-
var added = false;
94-
if (!added) {
95-
$('<tr/>', {
96-
id: msgName
97-
}).appendTo('#log');
98-
}
96+
$('<tr/>', {
97+
id: msgName
98+
}).appendTo('#log');
9999

100100
$('<td/>', {
101101
id: msgName + '_label',
@@ -118,9 +118,9 @@ function addToDisplay(msgName) {
118118
}
119119

120120
function updateDisplay(dataPoint) {
121-
msg = dataPoint.current_data
121+
var msg = dataPoint.current_data
122122

123-
if (!($('#' + msg.name).length > 0)) {
123+
if ($('#' + msg.name).length <= 0) {
124124
addToDisplay(msg.name);
125125
}
126126

0 commit comments

Comments
 (0)