Skip to content
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

Draft
wants to merge 88 commits into
base: devel
Choose a base branch
from
Draft

Work/dp catalog #2713

wants to merge 88 commits into from

Conversation

timcanham
Copy link
Collaborator

Related Issue(s)
Has Unit Tests (y/n)
Documentation Included (y/n)

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.

this->m_stateFileEntries = 0;
}

Fw::CmdResponse DpCatalog::loadStateFile() {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
return Fw::CmdResponse::OK;
}

void DpCatalog::getFileState(DpStateEntry& entry) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
}
}

void DpCatalog::pruneAndWriteStateFile() {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
stateFile.close();
}

void DpCatalog::appendFileState(const DpStateEntry& entry) {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
return Fw::CmdResponse::OK;
}

Fw::CmdResponse DpCatalog::fillBinaryTree() {

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
Copy link

@github-advanced-security github-advanced-security bot left a 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

slotSize uses the basic integral type unsigned long rather than a typedef with size and signedness.

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

slot uses the basic integral type unsigned long rather than a typedef with size and signedness.
Svc/DpCatalog/DpCatalog.cpp Fixed Show fixed Hide fixed
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

entry uses the basic integral type unsigned long rather than a typedef with size and signedness.
// 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

size uses the basic integral type signed long rather than a typedef with size and signedness.

// 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

record uses the basic integral type unsigned long rather than a typedef with size and signedness.

struct DpDstateFileEntry {
bool used; //!< if the entry is used

Check notice

Code scanning / CodeQL

Use of basic integral type Note

used uses the basic integral type bool rather than a typedef with size and signedness.

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

visited uses the basic integral type bool rather than a typedef with size and signedness.
@@ -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

m_stateFileEntries uses the basic integral type unsigned long rather than a typedef with size and signedness.
@@ -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

DP_FILENAME_FORMAT uses the basic integral type char rather than a typedef with size and signedness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants