-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Work/dp catalog #2713
base: devel
Are you sure you want to change the base?
Work/dp catalog #2713
Conversation
this->m_stateFileEntries = 0; | ||
} | ||
|
||
Fw::CmdResponse DpCatalog::loadStateFile() { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
return Fw::CmdResponse::OK; | ||
} | ||
|
||
void DpCatalog::getFileState(DpStateEntry& entry) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
} | ||
} | ||
|
||
void DpCatalog::pruneAndWriteStateFile() { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
stateFile.close(); | ||
} | ||
|
||
void DpCatalog::appendFileState(const DpStateEntry& entry) { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
return Fw::CmdResponse::OK; | ||
} | ||
|
||
Fw::CmdResponse DpCatalog::fillBinaryTree() { |
Check notice
Code scanning / CodeQL
Long function without assertion Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
this->m_memSize = DP_MAX_FILES * (sizeof(DpStateEntry) + sizeof(DpSortedList)); | ||
// = number of file slots * (Free list entry + traverse stack entry) | ||
// FIXME: Memory size hack | ||
static const FwSizeType slotSize = sizeof(DpBtreeNode) + sizeof(DpBtreeNode**) + sizeof(DpDstateFileEntry); |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
|
||
void DpCatalog::resetStateFileData() { | ||
// clear state file data | ||
for (FwSizeType slot = 0; slot < this->m_numDpSlots; slot++) { |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
this->m_stateFileEntries = 0; | ||
|
||
// read entries from the state file | ||
for (FwSizeType entry = 0; entry < this->m_numDpSlots; entry++) { |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
// read entries from the state file | ||
for (FwSizeType entry = 0; entry < this->m_numDpSlots; entry++) { | ||
|
||
FwSignedSizeType size = sizeof(buffer); |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
|
||
// traverse the tree, finding nodes in order. Max iteration of the loop | ||
// would be the number of records in the tree | ||
for (FwSizeType record = 0; record < this->m_numDpRecords; record++) { |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
|
||
struct DpDstateFileEntry { | ||
bool used; //!< if the entry is used |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
|
||
struct DpDstateFileEntry { | ||
bool used; //!< if the entry is used | ||
bool visited; //!< used for state file state; indicates that the entry was found in the search of current data products |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
@@ -179,17 +236,20 @@ | |||
FwSizeType m_numDirectories; //!< number of supplied directories | |||
Fw::String m_fileList[DP_MAX_FILES]; //!< working array of files/directory | |||
|
|||
Fw::FileNameString m_stateFile; //!< file to store transmit state | |||
DpDstateFileEntry* m_stateFileData; //!< DP state loaded from file | |||
FwSizeType m_stateFileEntries; //!< size of state file data |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
@@ -17,6 +17,7 @@ | |||
|
|||
// The format string for a file name | |||
// The format arguments are base directory, container ID, time seconds, and time microseconds | |||
constexpr const char *DP_FILENAME_FORMAT = "%s/Dp_%08" PRI_FwDpIdType "_%08" PRIu32 "_%08" PRIu32 ".fdp"; | |||
#define DP_EXT ".fdp" | |||
constexpr const char *DP_FILENAME_FORMAT = "%s/Dp_%08" PRI_FwDpIdType "_%08" PRIu32 "_%08" PRIu32 DP_EXT; |
Check notice
Code scanning / CodeQL
Use of basic integral type Note
Change Description
A description of the changes contained in the PR.
Rationale
A rationale for this change. e.g. fixes bug, or most projects need XYZ feature.
Testing/Review Recommendations
Fill in testing procedures, specific items to focus on for review, or other info to help the team verify these changes are flight-quality.
Future Work
Note any additional work that will be done relating to this issue.