MSS icon indicating copy to clipboard operation
MSS copied to clipboard

Remove duplication of class attributes

Open matrss opened this issue 1 year ago • 0 comments
trafficstars

This came up in #2326. There are some locations in which attributes of classes are duplicated in a way in which it is easy for them to become out-of-sync. For example, there is an active_op_id attribute in multiple places (https://github.com/search?q=repo%3AOpen-MSS%2FMSS+active_op_id&type=code) and there is no clear way in which they are all kept up-to-date, even though there can only ever be one.

The active flighttrack has the same issue, it exists as an attribute in multiple locations (https://github.com/search?q=repo%3AOpen-MSS%2FMSS+%22self.active_flight_track+%3D%22+OR+%22self.active_flighttrack+%3D%22+OR+%22self.activeflighttrack+%3D%22&type=code) while I am pretty sure that there should only be one active at a time.

Similarily, there are locations where additional references to attributes of another object are created, which really should be accessed directly through the containing object (e.g. here: https://github.com/search?q=repo%3AOpen-MSS%2FMSS+mainwindow_signal&type=code).

I think we need to check the code for duplication of state that really should have only one source of truth.

matrss avatar May 06 '24 08:05 matrss