project_name
string
class_name
string
class_modifiers
string
class_implements
int64
class_extends
int64
function_name
string
function_body
string
cyclomatic_complexity
int64
NLOC
int64
num_parameter
int64
num_token
int64
num_variable
int64
start_line
int64
end_line
int64
function_index
int64
function_params
string
function_variable
string
function_return_type
string
function_body_line_type
string
function_num_functions
int64
function_num_lines
int64
outgoing_function_count
int64
outgoing_function_names
string
incoming_function_count
int64
incoming_function_names
string
lexical_representation
string
nasa_fprime-tools
public
public
0
0
get_canonical_name
def get_canonical_name(cls):"""Returns the fprime C++ name for the type"""return cls.__name__.replace("Type", "")
1
2
1
17
0
26
28
26
null
[]
None
null
0
0
0
null
0
null
The function (get_canonical_name) defined within the public class called public.The function start at line 26 and ends at 28. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Gets the integer bits of a given type"""
1
1
1
6
0
32
33
32
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 32 and ends at 33. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
getSize
def getSize(cls):"""Gets the size of the integer based on the size specified in the class name"""return int(cls.get_bits() >> 3)# Divide by 8 quickly
1
2
1
18
0
36
38
36
null
[]
None
null
0
0
0
null
0
null
The function (getSize) defined within the public class called public.The function start at line 36 and ends at 38. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
getMaxSize
def getMaxSize(cls):"""Maximum size of type"""return cls.getSize()# Always the same as getSize
1
2
1
12
0
41
43
41
null
[]
None
null
0
0
0
null
0
null
The function (getMaxSize) defined within the public class called public.The function start at line 41 and ends at 43. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Gets the format serialization string such that the class can be serialized via struct"""raise NotImplementedError("get_serialize_format")
1
2
0
10
0
47
49
47
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 47 and ends at 49. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
serialize
def serialize(self):"""Serializes this type using struct and the val property"""if self._val is None:raise NotInitializedException(type(self))return struct.pack(self.get_serialize_format(), self._val)
2
4
1
36
0
51
55
51
null
[]
None
null
0
0
0
null
0
null
The function (serialize) defined within the public class called public.The function start at line 51 and ends at 55. It contains 4 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
deserialize
def deserialize(self, data, offset):"""Serializes this type using struct and the val property"""try:self._val = struct.unpack_from(self.get_serialize_format(), data, offset)[0]except struct.error as err:raise DeserializeException(str(err))
2
5
3
48
0
57
62
57
null
[]
None
null
0
0
0
null
0
null
The function (deserialize) defined within the public class called public.The function start at line 57 and ends at 62. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [57.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""
1
1
1
6
0
70
71
70
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 70 and ends at 71. It contains 1 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
validate
def validate(cls, val):"""Validates the given integer."""if not isinstance(val, int):raise TypeMismatchException(int, type(val))min_val, max_val = cls.range()if val < min_val or val > max_val:raise TypeRangeException(val)
4
6
2
50
0
74
80
74
null
[]
None
null
0
0
0
null
0
null
The function (validate) defined within the public class called public.The function start at line 74 and ends at 80. It contains 6 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [74.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
validate
def validate(cls, val):"""Validates the given integer."""if not isinstance(val, (float, int)):raise TypeMismatchException(float, type(val))
2
3
2
31
0
87
90
87
null
[]
None
null
0
0
0
null
0
null
The function (validate) defined within the public class called public.The function start at line 87 and ends at 90. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [87.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""return (-128, 127)
1
2
1
13
0
97
99
97
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 97 and ends at 99. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
102
104
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 102 and ends at 104. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
107
109
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 107 and ends at 109. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""return (-128, 127)
1
2
1
13
0
116
118
97
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 116 and ends at 118. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
121
123
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 121 and ends at 123. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
126
128
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 126 and ends at 128. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""return (-128, 127)
1
2
1
13
0
135
137
97
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 135 and ends at 137. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
140
142
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 140 and ends at 142. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
145
147
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 145 and ends at 147. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""return (-128, 127)
1
2
1
13
0
154
156
97
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 154 and ends at 156. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
159
161
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 159 and ends at 161. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
164
166
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 164 and ends at 166. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""return (0, 0xFF)
1
2
1
12
0
173
175
173
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 173 and ends at 175. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
178
180
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 178 and ends at 180. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
183
185
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 183 and ends at 185. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""return (0, 0xFF)
1
2
1
12
0
192
194
173
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 192 and ends at 194. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
197
199
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 197 and ends at 199. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
202
204
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 202 and ends at 204. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""return (0, 0xFF)
1
2
1
12
0
211
213
173
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 211 and ends at 213. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
216
218
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 216 and ends at 218. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
221
223
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 221 and ends at 223. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
range
def range(cls):"""Gets signed/unsigned of this type"""return (0, 0xFF)
1
2
1
12
0
230
232
173
null
[]
None
null
0
0
0
null
0
null
The function (range) defined within the public class called public.The function start at line 230 and ends at 232. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
235
237
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 235 and ends at 237. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
240
242
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 240 and ends at 242. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
249
251
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 249 and ends at 251. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
254
256
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 254 and ends at 256. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_bits
def get_bits(cls):"""Get the bit count of this type"""return 8
1
2
1
8
0
263
265
102
null
[]
None
null
0
0
0
null
0
null
The function (get_bits) defined within the public class called public.The function start at line 263 and ends at 265. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
get_serialize_format
def get_serialize_format():"""Allows serialization using struct"""return "b"
1
2
0
7
0
268
270
107
null
[]
None
null
0
0
0
null
0
null
The function (get_serialize_format) defined within the public class called public.The function start at line 268 and ends at 270. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
construct_type
def construct_type(cls, name, member_list):"""Construct a new serializable sub-typeConstructs a new serializable subtype from the supplied member list and name. Member list may optionally excludedescription keys, which will be filled with None.Args:name: name of the new sub-typemember_list: list of member definitions i...
10
14
3
163
0
33
58
33
null
[]
None
null
0
0
0
null
0
null
The function (construct_type) defined within the public class called public.The function start at line 33 and ends at 58. It contains 14 lines of code and it has a cyclomatic complexity of 10. It takes 3 parameters, represented as [33.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
validate
def validate(cls, val):"""Validate this object including member list and values"""# Ensure that the supplied value is a dictionaryif not isinstance(val, dict):raise TypeMismatchException(dict, type(val))if len(val) != len(cls.MEMBER_LIST):raise IncorrectMembersException([name for name, _, _, _ in cls.MEMBER_LIST])# Now...
6
11
2
94
0
61
74
61
null
[]
None
null
0
0
0
null
0
null
The function (validate) defined within the public class called public.The function start at line 61 and ends at 74. It contains 11 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [61.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
val
def val(self) -> dict:"""The .val property typically returns the python-native type. This the python native type closes to a serializablewithout generating full classes would be a dictionary (anonymous object). This returns such an object.:return dictionary of member names to python values of member keys"""if self._val...
3
7
1
44
0
77
89
77
null
[]
None
null
0
0
0
null
0
null
The function (val) defined within the public class called public.The function start at line 77 and ends at 89. It contains 7 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
val
def val(self, val: dict):"""The .val property typically returns the python-native type. This the python native type closes to a serializablewithout generating full classes would be a dictionary (anonymous object). This takes such an object and sets themember val list from it.:param val: dictionary containing python typ...
2
6
2
46
0
92
104
92
null
[]
None
null
0
0
0
null
0
null
The function (val) defined within the public class called public.The function start at line 92 and ends at 104. It contains 6 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [92.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
formatted_val
def formatted_val(self) -> dict:"""Format all the members of dict according to the member_format.Note 1: All elements will be cast to strNote 2: If a member is an array will call array formatted_val:return a formatted dict"""result = {}for member_name, _, member_format, _ in self.MEMBER_LIST:value_object = self._val[me...
3
9
1
66
0
107
121
107
null
[]
None
null
0
0
0
null
0
null
The function (formatted_val) defined within the public class called public.The function start at line 107 and ends at 121. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
serialize
def serialize(self):"""Serializes the members of the serializable"""if self._val is None:raise NotInitializedException(type(self))return b"".join([self._val.get(member_name).serialize()for member_name, _, _, _ in self.MEMBER_LIST])
3
9
1
54
0
123
132
123
null
[]
None
null
0
0
0
null
0
null
The function (serialize) defined within the public class called public.The function start at line 123 and ends at 132. It contains 9 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
deserialize
def deserialize(self, data, offset):"""Deserialize the values of each of the members"""new_value = {}for member_name, member_type, _, _ in self.MEMBER_LIST:try:new_member = member_type()new_member.deserialize(data, offset)new_value[member_name] = new_memberoffset += new_member.getSize()except Exception as exc:raise Des...
3
13
3
71
0
134
147
134
null
[]
None
null
0
0
0
null
0
null
The function (deserialize) defined within the public class called public.The function start at line 134 and ends at 147. It contains 13 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [134.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
getSize
def getSize(self):"""The size of a struct is the size of all the members"""return sum(self._val.get(name).getSize() for name, _, _, _ in self.MEMBER_LIST)
2
2
1
34
0
149
151
149
null
[]
None
null
0
0
0
null
0
null
The function (getSize) defined within the public class called public.The function start at line 149 and ends at 151. It contains 2 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
getMaxSize
def getMaxSize(cls):"""Return the maximum size in bytes of the array"""return sum(member_type.getMaxSize() for _, member_type, _, _ in cls.MEMBER_LIST)
2
2
1
27
0
154
156
154
null
[]
None
null
0
0
0
null
0
null
The function (getMaxSize) defined within the public class called public.The function start at line 154 and ends at 156. It contains 2 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
to_jsonable
def to_jsonable(self):"""JSONable type for a serializable"""members = {}for member_name, member_value, member_format, member_desc in self.MEMBER_LIST:value = ({"value": None}if self._val is Noneelse self._val.get(member_name).to_jsonable())members[member_name] = {"format": member_format, "description": member_desc}memb...
3
11
1
76
0
158
171
158
null
[]
None
null
0
0
0
null
0
null
The function (to_jsonable) defined within the public class called public.The function start at line 158 and ends at 171. It contains 11 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
items.items_generator
def items_generator():"""Generator of items"""for member_name, _, _, _ in self.MEMBER_LIST:yield member_name, self._val.get(member_name)
2
3
0
29
0
176
179
176
null
[]
None
null
0
0
0
null
0
null
The function (items.items_generator) defined within the public class called public.The function start at line 176 and ends at 179. It contains 3 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
items
def items(self):"""Allow dictionary like iteration"""def items_generator():"""Generator of items"""for member_name, _, _, _ in self.MEMBER_LIST:yield member_name, self._val.get(member_name)return items_generator()
1
3
1
12
0
173
181
173
null
[]
None
null
0
0
0
null
0
null
The function (items) defined within the public class called public.The function start at line 173 and ends at 181. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
construct_type
def construct_type(cls, name, max_length=None):"""Constructs a new string type with given name and maximum length"""return type_base.DictionaryType.construct_type(cls, name, MAX_LENGTH=max_length)
1
2
3
27
0
31
33
31
null
[]
None
null
0
0
0
null
0
null
The function (construct_type) defined within the public class called public.The function start at line 31 and ends at 33. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [31.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
validate
def validate(cls, val):"""Validates that this is a string"""if not isinstance(val, str):raise TypeMismatchException(str, type(val))if cls.MAX_LENGTH is not None and len(val) > cls.MAX_LENGTH:raise StringSizeException(len(val), cls.MAX_LENGTH)
4
5
2
56
0
36
41
36
null
[]
None
null
0
0
0
null
0
null
The function (validate) defined within the public class called public.The function start at line 36 and ends at 41. It contains 5 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [36.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
serialize
def serialize(self):"""Serializes the string in a binary format"""# If val is never set then it is init exception...if self.val is None:raise NotInitializedException(type(self))# Check string size before serializingif self.MAX_LENGTH is not None and len(self.val) > self.MAX_LENGTH:raise StringSizeException(len(self.val...
4
6
1
77
0
43
54
43
null
[]
None
null
0
0
0
null
0
null
The function (serialize) defined within the public class called public.The function start at line 43 and ends at 54. It contains 6 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
deserialize
def deserialize(self, data, offset):"""Deserializes a string from the given data buffer."""try:val_size = struct.unpack_from(">H", data, offset)[0]# Deal with not enough data left in the bufferif len(data[offset + 2 :]) < val_size:msg = f"Not enough data to deserialize string data. Needed: {val_size} Left: {len(data[of...
5
11
3
104
0
56
71
56
null
[]
None
null
0
0
0
null
0
null
The function (deserialize) defined within the public class called public.The function start at line 56 and ends at 71. It contains 11 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [56.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
getSize
def getSize(self):"""Get the size of this object"""return struct.calcsize(">H") + len(self.val)
1
2
1
20
0
73
77
73
null
[]
None
null
0
0
0
null
0
null
The function (getSize) defined within the public class called public.The function start at line 73 and ends at 77. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
getMaxSize
def getMaxSize(cls):"""Get maximum size of the type"""return struct.calcsize(">H") + cls.MAX_LENGTH
1
2
1
17
0
80
82
80
null
[]
None
null
0
0
0
null
0
null
The function (getMaxSize) defined within the public class called public.The function start at line 80 and ends at 82. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
__init__
def __init__(self, time_base=0, time_context=0, seconds=0, useconds=0):"""ConstructorArgstime_base (int): Time base index for the time tag. Must be a valid integer for a TimeBase Enum value.time_context (int): Time context for the time tagseconds (int): Seconds elapsed since specified time baseuseconds (int): Microseco...
1
8
5
73
0
61
89
61
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 61 and ends at 89. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [61.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
_check_useconds
def _check_useconds(useconds):"""Checks if a given microsecond value is valid.Args:usecs (int): The value to checkReturns:None if valid, raises TypeRangeException if not valid."""if (useconds < 0) or (useconds > 999999):raise TypeRangeException(useconds)
3
3
1
24
0
92
103
92
null
[]
None
null
0
0
0
null
0
null
The function (_check_useconds) defined within the public class called public.The function start at line 92 and ends at 103. It contains 3 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
_check_time_base
def _check_time_base(time_base):"""Checks if a given TimeBase value is valid.Args:time_base (int): The value to checkReturns:Returns if valid, raises TypeRangeException if not valid."""# Construct list of possible values for TimeBase enumvalid_vals = [member.value for member in list(TimeBase)]if time_base not in valid_...
3
4
1
31
0
106
120
106
null
[]
None
null
0
0
0
null
0
null
The function (_check_time_base) defined within the public class called public.The function start at line 106 and ends at 120. It contains 4 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
to_jsonable
def to_jsonable(self):"""JSONable object format"""return {"type": self.__repr__(),"base": self.__timeBase,"context": self.__timeContext,"seconds": self.seconds,"microseconds": self.useconds,}
1
8
1
41
0
122
132
122
null
[]
None
null
0
0
0
null
0
null
The function (to_jsonable) defined within the public class called public.The function start at line 122 and ends at 132. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
timeBase
def timeBase(self):return TimeBase(self.__timeBase.val)
1
2
1
14
0
135
136
135
null
[]
None
null
0
0
0
null
0
null
The function (timeBase) defined within the public class called public.The function start at line 135 and ends at 136. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
timeBase
def timeBase(self, val):self._check_time_base(val)self.__timeBase = U16Type(val)
1
3
2
21
0
139
141
139
null
[]
None
null
0
0
0
null
0
null
The function (timeBase) defined within the public class called public.The function start at line 139 and ends at 141. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [139.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
timeContext
def timeContext(self):return self.__timeContext.val
1
2
1
11
0
144
145
144
null
[]
None
null
0
0
0
null
0
null
The function (timeContext) defined within the public class called public.The function start at line 144 and ends at 145. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
timeContext
def timeContext(self, val):self.__timeContext = U8Type(val)
1
2
2
15
0
148
149
148
null
[]
None
null
0
0
0
null
0
null
The function (timeContext) defined within the public class called public.The function start at line 148 and ends at 149. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [148.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
seconds
def seconds(self):return self.__secs.val
1
2
1
11
0
152
153
152
null
[]
None
null
0
0
0
null
0
null
The function (seconds) defined within the public class called public.The function start at line 152 and ends at 153. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
seconds
def seconds(self, val):self.__secs = U32Type(val)
1
2
2
15
0
156
157
156
null
[]
None
null
0
0
0
null
0
null
The function (seconds) defined within the public class called public.The function start at line 156 and ends at 157. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [156.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
useconds
def useconds(self):return self.__usecs.val
1
2
1
11
0
160
161
160
null
[]
None
null
0
0
0
null
0
null
The function (useconds) defined within the public class called public.The function start at line 160 and ends at 161. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
useconds
def useconds(self, val):self._check_useconds(val)self.__usecs = U32Type(val)
1
3
2
21
0
164
166
164
null
[]
None
null
0
0
0
null
0
null
The function (useconds) defined within the public class called public.The function start at line 164 and ends at 166. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [164.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
serialize
def serialize(self):"""Serializes the time typeReturns:Byte array containing serialized time type"""buf = b""buf += self.__timeBase.serialize()buf += self.__timeContext.serialize()buf += self.__secs.serialize()buf += self.__usecs.serialize()return buf
1
7
1
48
0
168
180
168
null
[]
None
null
0
0
0
null
0
null
The function (serialize) defined within the public class called public.The function start at line 168 and ends at 180. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
deserialize
def deserialize(self, data, offset):"""Deserializes a serialized time type in data starting at offset.Internal values to the object are updated.Args:data: binary data containing the time tag (type = bytearray)offset: Index in data where time tag starts"""# Decode Time Baseself.__timeBase.deserialize(data, offset)offset...
1
9
3
86
0
182
207
182
null
[]
None
null
0
0
0
null
0
null
The function (deserialize) defined within the public class called public.The function start at line 182 and ends at 207. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [182.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
getSize
def getSize(cls):"""Return the size of the time type object when serializedReturns:The size of the time type object when serialized"""return (U16Type.getSize() + U8Type.getSize() + U32Type.getSize() + U32Type.getSize())
1
4
1
32
0
210
219
210
null
[]
None
null
0
0
0
null
0
null
The function (getSize) defined within the public class called public.The function start at line 210 and ends at 219. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
getMaxSize
def getMaxSize(cls):"""Return the size of the time type object when serializedReturns:The size of the time type object when serialized"""# Always the same as getSize. Must be updated when time types are configurable.return cls.getSize()
1
2
1
12
0
222
230
222
null
[]
None
null
0
0
0
null
0
null
The function (getMaxSize) defined within the public class called public.The function start at line 222 and ends at 230. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
compare.cmp
def cmp(x, y):return (x > y) - (x < y)# added to support Python 2/3
1
2
2
19
0
244
245
244
null
[]
None
null
0
0
0
null
0
null
The function (compare.cmp) defined within the public class called public.The function start at line 244 and ends at 245. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [244.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
compare
def compare(t1, t2):"""Compares two TimeType objectsThis function sorts times in the order of: timeBase, secs, usecs, andthen timeContext.Returns:Negative, 0, or positive for t1<t2, t1==t2, t1>t2 respectively"""def cmp(x, y):return (x > y) - (x < y)# added to support Python 2/3# Compare Basebase_cmp = cmp(t1.timeBase.v...
4
10
2
81
0
233
259
233
null
[]
None
null
0
0
0
null
0
null
The function (compare) defined within the public class called public.The function start at line 233 and ends at 259. It contains 10 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [233.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__str__
def __str__(self):"""Formats the time type object for printingReturns:A string representing the time type object"""return "(%d(%d)-%d:%d)" % (self.__timeBase.val,self.__timeContext.val,self.__secs.val,self.__usecs.val,)
1
7
1
35
0
261
273
261
null
[]
None
null
0
0
0
null
0
null
The function (__str__) defined within the public class called public.The function start at line 261 and ends at 273. It contains 7 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
to_readable
def to_readable(self, time_zone=None):"""Returns a string of the time object in a human readable formatArgs:time_zone (tzinfo): Time zone to convert the TimeTypeobject to before printing. Timezone also displayed.If time_zone=None, local timezone is used.Defaults to None.Returns:A human readable string representing the ...
2
10
2
64
0
275
301
275
null
[]
None
null
0
0
0
null
0
null
The function (to_readable) defined within the public class called public.The function start at line 275 and ends at 301. It contains 10 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [275.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
get_datetime
def get_datetime(self, tz=None):"""Returns the python datetime object for UTC timeArgs:tz (tzinfo): timezone to create the datetime object in. If tz=None, local time zone used. Defaults to None.Returns:datetime object for the time type or None if the time couldn'tbe determined."""tb = TimeBase(self.__timeBase.val)dt = ...
2
7
2
70
0
303
325
303
null
[]
None
null
0
0
0
null
0
null
The function (get_datetime) defined within the public class called public.The function start at line 303 and ends at 325. It contains 7 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [303.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
set_datetime
def set_datetime(self, dt, time_base=0xFFFF):"""Sets the timebase from a datetime object.Args:dt (datetime): datetime object to read from time."""total_seconds = (dt - datetime.datetime.fromtimestamp(0)).total_seconds()seconds = int(total_seconds)useconds = int((total_seconds - seconds) * 1000000)self._check_time_base(...
1
9
3
84
0
327
343
327
null
[]
None
null
0
0
0
null
0
null
The function (set_datetime) defined within the public class called public.The function start at line 327 and ends at 343. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [327.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
get_float
def get_float(self):"""a helper method that gets the current TimeType as a float where the non-fraction is secondsand the fraction is microseconds. This enables comparisons with numbers."""return self.seconds + (self.useconds / 1000000)
1
2
1
18
0
348
353
348
null
[]
None
null
0
0
0
null
0
null
The function (get_float) defined within the public class called public.The function start at line 348 and ends at 353. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
__lt__
def __lt__(self, other):"""Less than"""if isinstance(other, TimeType):return self.compare(self, other) < 0return self.get_float() < other
2
4
2
35
0
355
359
355
null
[]
None
null
0
0
0
null
0
null
The function (__lt__) defined within the public class called public.The function start at line 355 and ends at 359. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [355.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__le__
def __le__(self, other):"""Less than or equal"""if isinstance(other, TimeType):return self.compare(self, other) <= 0return self.get_float() <= other
2
4
2
35
0
361
365
361
null
[]
None
null
0
0
0
null
0
null
The function (__le__) defined within the public class called public.The function start at line 361 and ends at 365. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [361.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__eq__
def __eq__(self, other):"""Equal"""if isinstance(other, TimeType):return self.compare(self, other) == 0return self.get_float() == other
2
4
2
35
0
367
371
367
null
[]
None
null
0
0
0
null
0
null
The function (__eq__) defined within the public class called public.The function start at line 367 and ends at 371. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [367.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__ne__
def __ne__(self, other):"""Not equal"""if isinstance(other, TimeType):return self.compare(self, other) != 0return self.get_float() != other
2
4
2
35
0
373
377
373
null
[]
None
null
0
0
0
null
0
null
The function (__ne__) defined within the public class called public.The function start at line 373 and ends at 377. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [373.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__gt__
def __gt__(self, other):"""Greater than"""if isinstance(other, TimeType):return self.compare(self, other) > 0return self.get_float() > other
2
4
2
35
0
379
383
379
null
[]
None
null
0
0
0
null
0
null
The function (__gt__) defined within the public class called public.The function start at line 379 and ends at 383. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [379.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__ge__
def __ge__(self, other):"""Greater than or equal"""if isinstance(other, TimeType):return self.compare(self, other) >= 0return self.get_float() >= other
2
4
2
35
0
385
389
385
null
[]
None
null
0
0
0
null
0
null
The function (__ge__) defined within the public class called public.The function start at line 385 and ends at 389. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [385.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
set_float
def set_float(self, num):"""a helper method that takes a float and sets a TimeType's seconds and useconds fields.Note: This method is private because it is only used by the _get_type_from_float helper togenerate new TimeType instances. It is not meant to be used to modify an existing timestamp.Note: Present implementat...
1
4
2
50
0
393
402
393
null
[]
None
null
0
0
0
null
0
null
The function (set_float) defined within the public class called public.The function start at line 393 and ends at 402. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [393.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
get_type_from_float
def get_type_from_float(self, num):"""a helper method that returns a new instance of TimeType and sets the seconds and usecondsfields using the given number. The new TimeType's time_base and time_context will bepreserved from the calling object."""tType = TimeType(self.__timeBase.val, self.__timeContext.val)tType.set_f...
1
4
2
32
0
404
412
404
null
[]
None
null
0
0
0
null
0
null
The function (get_type_from_float) defined within the public class called public.The function start at line 404 and ends at 412. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [404.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__add__
def __add__(self, other):"""Addition"""if isinstance(other, TimeType):other = other.get_float()num = self.get_float() + otherreturn self.get_type_from_float(num)
2
5
2
39
0
416
421
416
null
[]
None
null
0
0
0
null
0
null
The function (__add__) defined within the public class called public.The function start at line 416 and ends at 421. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [416.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__sub__
def __sub__(self, other):"""Subtraction"""if isinstance(other, TimeType):other = other.get_float()num = self.get_float() - otherreturn self.get_type_from_float(num)
2
5
2
39
0
423
428
423
null
[]
None
null
0
0
0
null
0
null
The function (__sub__) defined within the public class called public.The function start at line 423 and ends at 428. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [423.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__mul__
def __mul__(self, other):"""Multiplication"""if isinstance(other, TimeType):other = other.get_float()num = self.get_float() * otherreturn self.get_type_from_float(num)
2
5
2
39
0
430
435
430
null
[]
None
null
0
0
0
null
0
null
The function (__mul__) defined within the public class called public.The function start at line 430 and ends at 435. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [430.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__truediv__
def __truediv__(self, other):"""True division"""if isinstance(other, TimeType):other = other.get_float()num = self.get_float() / otherreturn self.get_type_from_float(num)
2
5
2
39
0
437
442
437
null
[]
None
null
0
0
0
null
0
null
The function (__truediv__) defined within the public class called public.The function start at line 437 and ends at 442. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [437.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__floordiv__
def __floordiv__(self, other):"""Floored division"""if isinstance(other, TimeType):other = other.get_float()num = self.get_float() // otherreturn self.get_type_from_float(num)
2
5
2
38
0
444
449
444
null
[]
None
null
0
0
0
null
0
null
The function (__floordiv__) defined within the public class called public.The function start at line 444 and ends at 449. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [444.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__radd__
def __radd__(self, other):"""Reflected addition"""if isinstance(other, TimeType):other = other.get_float()num = other + self.get_float()return self.get_type_from_float(num)
2
5
2
39
0
453
458
453
null
[]
None
null
0
0
0
null
0
null
The function (__radd__) defined within the public class called public.The function start at line 453 and ends at 458. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [453.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__rsub__
def __rsub__(self, other):"""Reflected subtraction"""if isinstance(other, TimeType):other = other.get_float()num = other - self.get_float()return self.get_type_from_float(num)
2
5
2
39
0
460
465
460
null
[]
None
null
0
0
0
null
0
null
The function (__rsub__) defined within the public class called public.The function start at line 460 and ends at 465. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [460.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__rmul__
def __rmul__(self, other):"""Reflected multiplication"""if isinstance(other, TimeType):other = other.get_float()num = other * self.get_float()return self.get_type_from_float(num)
2
5
2
39
0
467
472
467
null
[]
None
null
0
0
0
null
0
null
The function (__rmul__) defined within the public class called public.The function start at line 467 and ends at 472. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [467.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__rtruediv__
def __rtruediv__(self, other):"""Reflected division"""if isinstance(other, TimeType):other = other.get_float()num = other / self.get_float()return self.get_type_from_float(num)
2
5
2
39
0
474
479
474
null
[]
None
null
0
0
0
null
0
null
The function (__rtruediv__) defined within the public class called public.The function start at line 474 and ends at 479. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [474.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
__rfloordiv__
def __rfloordiv__(self, other):"""Reflected floored division"""if isinstance(other, TimeType):other = other.get_float()num = other // self.get_float()return self.get_type_from_float(num)
2
5
2
34
0
481
486
481
null
[]
None
null
0
0
0
null
0
null
The function (__rfloordiv__) defined within the public class called public.The function start at line 481 and ends at 486. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [481.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
serialize
def serialize(self):"""Serializes the current object type."""raise AbstractMethodException("serialize")
1
2
1
11
0
19
23
19
null
[]
None
null
0
0
0
null
0
null
The function (serialize) defined within the public class called public.The function start at line 19 and ends at 23. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
nasa_fprime-tools
public
public
0
0
deserialize
def deserialize(self, data, offset):"""AbstractDeserialize interface"""raise AbstractMethodException("deserialize")
1
2
3
15
0
26
30
26
null
[]
None
null
0
0
0
null
0
null
The function (deserialize) defined within the public class called public.The function start at line 26 and ends at 30. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [26.0] and does not return any value..
nasa_fprime-tools
public
public
0
0
getSize
def getSize(self):"""Abstract getSize interface"""raise AbstractMethodException("getSize")
1
2
1
11
0
33
37
33
null
[]
None
null
0
0
0
null
0
null
The function (getSize) defined within the public class called public.The function start at line 33 and ends at 37. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..