This commit is contained in:
Quantum Leaps 2017-09-24 21:02:45 -04:00
parent a3fc0e5871
commit 4116239a1f
9 changed files with 142 additions and 89 deletions

View File

@ -9,7 +9,7 @@
License Type: Windows Single User License
Licensed To : Quantum Leaps, LLC
License No. : WS2975 License Date: Dec 15, 2013
Build Date : Sep 2 2009 Run Date: Sep 15, 2017
Build Date : Sep 2 2009 Run Date: Sep 24, 2017
(C)1996-2009 M Squared Technologies LLC
________________________________________________________________________
@ -1064,11 +1064,9 @@
Parameters: (QEvt const * const e, uint_fast16_t const margin)
Cyclomatic Complexity Vg Detail
Function Base : 1
Conditional if / else if: 5
Logical or ( || ) : 1
Logical and ( && ) : 1
Complexity Param 2 Return 1 Cyclo Vg 8 Total 11
LOC 59 eLOC 49 lLOC 34 Comment 63 Lines 81
Conditional if / else if: 8
Complexity Param 2 Return 1 Cyclo Vg 9 Total 12
LOC 72 eLOC 58 lLOC 39 Comment 68 Lines 94
Function: QP::QActive::postLIFO
Parameters: (QEvt const * const e)
@ -1129,27 +1127,27 @@
~~ Total File Summary ~~
LOC 218 eLOC 187 lLOC 105 Comment 230 Lines 412
LOC 231 eLOC 196 lLOC 110 Comment 235 Lines 425
------------------------------------------------------------------------
~~ File Functional Summary ~~
File Function Count....: 9
Total Function LOC.....: 192 Total Function Pts LOC : 4.1
Total Function eLOC....: 162 Total Function Pts eLOC: 3.5
Total Function lLOC....: 105 Total Function Pts lLOC: 2.0
Total Function LOC.....: 205 Total Function Pts LOC : 4.4
Total Function eLOC....: 171 Total Function Pts eLOC: 3.7
Total Function lLOC....: 110 Total Function Pts lLOC: 2.1
Total Function Params .: 10 Total Function Return .: 9
Total Cyclo Complexity : 25 Total Function Complex.: 44
Total Cyclo Complexity : 26 Total Function Complex.: 45
------ ----- ----- ------ ------ -----
Max Function LOC ......: 59 Average Function LOC ..: 21.33
Max Function eLOC .....: 49 Average Function eLOC .: 18.00
Max Function lLOC .....: 34 Average Function lLOC .: 11.67
Max Function LOC ......: 72 Average Function LOC ..: 22.78
Max Function eLOC .....: 58 Average Function eLOC .: 19.00
Max Function lLOC .....: 39 Average Function lLOC .: 12.22
------ ----- ----- ------ ------ -----
Max Function Parameters: 2 Avg Function Parameters: 1.11
Max Function Returns ..: 1 Avg Function Returns ..: 1.00
Max Interface Complex. : 3 Avg Interface Complex. : 2.11
Max Cyclomatic Complex.: 8 Avg Cyclomatic Complex.: 2.78
Max Total Complexity ..: 11 Avg Total Complexity ..: 4.89
Max Cyclomatic Complex.: 9 Avg Cyclomatic Complex.: 2.89
Max Total Complexity ..: 12 Avg Total Complexity ..: 5.00
________________________________________________________________________
End of File: ..\src\qf\qf_actq.cpp
@ -2233,9 +2231,9 @@
~~ Total Project Summary ~~
LOC 4867 eLOC 4313 lLOC 1882 Comment 6438 Lines 11588
LOC 4880 eLOC 4322 lLOC 1887 Comment 6443 Lines 11601
Average per File, metric/37 files
LOC 131 eLOC 116 lLOC 50 Comment 174 Lines 313
LOC 131 eLOC 116 lLOC 51 Comment 174 Lines 313
------------------------------------------------------------------------
@ -2675,8 +2673,8 @@
Function: QP::QActive::post_
Parameters: (QEvt const * const e, uint_fast16_t const margin)
Complexity Param 2 Return 1 Cyclo Vg 8 Total 11
LOC 59 eLOC 49 lLOC 34 Comment 63 Lines 81
Complexity Param 2 Return 1 Cyclo Vg 9 Total 12
LOC 72 eLOC 58 lLOC 39 Comment 68 Lines 94
Function: QP::QActive::postLIFO
Parameters: (QEvt const * const e)
@ -3136,26 +3134,26 @@
LOC 14 eLOC 11 lLOC 7 Comment 2 Lines 16
Total: Functions
LOC 2739 eLOC 2284 lLOC 1362 InCmp 340 CycloCmp 464
Function Points FP(LOC) 46.7 FP(eLOC) 39.5 FP(lLOC) 23.8
LOC 2752 eLOC 2293 lLOC 1367 InCmp 340 CycloCmp 465
Function Points FP(LOC) 46.9 FP(eLOC) 39.7 FP(lLOC) 23.9
------------------------------------------------------------------------
~~ Project Functional Analysis ~~
Total Functions .......: 175 Total Physical Lines ..: 3791
Total LOC .............: 2739 Total Function Pts LOC : 46.7
Total eLOC ............: 2284 Total Function Pts eLOC: 39.5
Total lLOC.............: 1362 Total Function Pts lLOC: 23.8
Total Cyclomatic Comp. : 464 Total Interface Comp. .: 340
Total Functions .......: 175 Total Physical Lines ..: 3804
Total LOC .............: 2752 Total Function Pts LOC : 46.9
Total eLOC ............: 2293 Total Function Pts eLOC: 39.7
Total lLOC.............: 1367 Total Function Pts lLOC: 23.9
Total Cyclomatic Comp. : 465 Total Interface Comp. .: 340
Total Parameters ......: 165 Total Return Points ...: 175
Total Comment Lines ...: 2692 Total Blank Lines .....: 513
Total Comment Lines ...: 2697 Total Blank Lines .....: 514
------ ----- ----- ------ ------ -----
Avg Physical Lines ....: 21.66
Avg LOC ...............: 15.65 Avg eLOC ..............: 13.05
Avg lLOC ..............: 7.78 Avg Cyclomatic Comp. ..: 2.65
Avg Physical Lines ....: 21.74
Avg LOC ...............: 15.73 Avg eLOC ..............: 13.10
Avg lLOC ..............: 7.81 Avg Cyclomatic Comp. ..: 2.66
Avg Interface Comp. ...: 1.94 Avg Parameters ........: 0.94
Avg Return Points .....: 1.00 Avg Comment Lines .....: 15.38
Avg Return Points .....: 1.00 Avg Comment Lines .....: 15.41
------ ----- ----- ------ ------ -----
Max LOC ...............: 117
Max eLOC ..............: 100 Max lLOC ..............: 61

View File

@ -2,8 +2,8 @@
/// @brief QF/C++ port to embOS (v4.00) kernel, all supported compilers
/// @cond
////**************************************************************************
/// Last updated for version 5.9.3
/// Last updated on 2017-06-19
/// Last updated for version 5.9.8
/// Last updated on 2017-09-20
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -159,9 +159,24 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_CRIT_ENTRY_();
nFree = static_cast<uint_fast16_t>(m_eQueue.maxMsg - m_eQueue.nofMsg);
if (((margin == QF_NO_MARGIN) && (nFree > static_cast<QEQueueCtr>(0)))
|| (nFree > static_cast<QEQueueCtr>(margin)))
{
if (margin == QF_NO_MARGIN) {
if (nFree > static_cast<QEQueueCtr>(0)) {
status = true; // can post
}
else {
status = false; // cannot post
Q_ERROR_ID(510); // must be able to post the event
}
}
else if (nFree > static_cast<QEQueueCtr>(margin)) {
status = true; // can post
}
else {
status = false; // cannot post
}
if (status) { // can post the event?
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO, QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // timestamp
QS_OBJ_(sender); // the sender object
@ -179,15 +194,11 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_CRIT_EXIT_();
// posting to the embOS mailbox must succeed, see NOTE3
Q_ALLEGE_ID(510,
Q_ALLEGE_ID(520,
OS_PutMailCond(&m_eQueue, static_cast<OS_CONST_PTR void *>(&e))
== static_cast<char>(0));
status = true; // report success
}
else {
// can tolerate dropping evts?
Q_ASSERT_ID(520, margin != QF_NO_MARGIN);
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_ATTEMPT,
QS::priv_.locFilter[QS::AO_OBJ], this)
@ -201,8 +212,6 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QS_END_NOCRIT_()
QF_CRIT_EXIT_();
status = false; // report failure
}
return status;

View File

@ -3,7 +3,7 @@
/// @cond
///***************************************************************************
/// Last Updated for Version: QP 5.4.0/Qt 5.x
/// Last updated on 2015-05-03
/// Last updated on 2017-09-20
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -30,8 +30,8 @@
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
/// https://state-machine.com
/// mailto:info@state-machine.com
///***************************************************************************
/// @endcond

View File

@ -2,8 +2,8 @@
/// @brief QF/C++ port to ThreadX, all supported compilers
/// @cond
////**************************************************************************
/// Last updated for version 5.9.3
/// Last updated on 2017-06-19
/// Last updated for version 5.9.8
/// Last updated on 2017-09-20
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -143,9 +143,24 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
uint_fast16_t nFree =
static_cast<uint_fast16_t>(m_eQueue.tx_queue_available_storage);
if (((margin == QF_NO_MARGIN) && (nFree > static_cast<QEQueueCtr>(0)))
|| (nFree > static_cast<QEQueueCtr>(margin)))
{
if (margin == QF_NO_MARGIN) {
if (nFree > static_cast<QEQueueCtr>(0)) {
status = true; // can post
}
else {
status = false; // cannot post
Q_ERROR_ID(510); // must be able to post the event
}
}
else if (nFree > static_cast<QEQueueCtr>(margin)) {
status = true; // can post
}
else {
status = false; // cannot post
}
if (status) { // can post the event?
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO, QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // timestamp
QS_OBJ_(sender); // the sender object
@ -164,15 +179,11 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_CRIT_EXIT_();
QEvt const *ep = const_cast<QEvt const *>(e);
Q_ALLEGE_ID(510,
Q_ALLEGE_ID(520,
tx_queue_send(&m_eQueue, static_cast<VOID *>(&ep), TX_NO_WAIT)
== TX_SUCCESS);
status = true; // report success
}
else {
// can tolerate dropping evts?
Q_ASSERT_ID(520, margin != QF_NO_MARGIN);
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_ATTEMPT,
QS::priv_.locFilter[QS::AO_OBJ], this)
@ -186,8 +197,6 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QS_END_NOCRIT_()
QF_CRIT_EXIT_();
status = false; // report failure
}
return status;

View File

@ -2,8 +2,8 @@
/// @brief QF/C++ port to uC/OS-II (V2.92) kernel, all supported compilers
/// @cond
////**************************************************************************
/// Last updated for version 5.9.3
/// Last updated on 2017-06-19
/// Last updated for version 5.9.8
/// Last updated on 2017-09-20
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -156,10 +156,26 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
reinterpret_cast<OS_Q_DATA *>(m_eQueue)->OSQSize
- reinterpret_cast<OS_Q_DATA *>(m_eQueue)->OSNMsgs);
if (((margin == QF_NO_MARGIN) && (nFree > static_cast<QEQueueCtr>(0)))
|| (nFree > static_cast<QEQueueCtr>(margin)))
{
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO, QS::priv_.locFilter[QS::AO_OBJ], this)
if (margin == QF_NO_MARGIN) {
if (nFree > static_cast<QEQueueCtr>(0)) {
status = true; // can post
}
else {
status = false; // cannot post
Q_ERROR_ID(710); // must be able to post the event
}
}
else if (nFree > static_cast<QEQueueCtr>(margin)) {
status = true; // can post
}
else {
status = false; // cannot post
}
if (status) { // can post the event?
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO,
QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // timestamp
QS_OBJ_(sender); // the sender object
QS_SIG_(e->sig); // the signal of the event
@ -176,14 +192,10 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_CRIT_EXIT_();
// posting the event to uC/OS-II message queue must succeed
Q_ALLEGE_ID(710,
Q_ALLEGE_ID(720,
OSQPost(m_eQueue, const_cast<QEvt *>(e)) == OS_ERR_NONE);
status = true; // report success
}
else {
// can tolerate dropping evts?
Q_ASSERT_ID(520, margin != QF_NO_MARGIN);
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_ATTEMPT,
QS::priv_.locFilter[QS::AO_OBJ], this)
@ -197,8 +209,6 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QS_END_NOCRIT_()
QF_CRIT_EXIT_();
status = false; // report failure
}
return status;
@ -208,7 +218,8 @@ void QActive::postLIFO(QEvt const * const e) {
QF_CRIT_STAT_
QF_CRIT_ENTRY_();
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_LIFO, QS::priv_.locFilter[QS::AO_OBJ], this)
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_LIFO,
QS::priv_.locFilter[QS::AO_OBJ], this)
QS_TIME_(); // timestamp
QS_SIG_(e->sig); // the signal of this event
QS_OBJ_(this); // this active object

View File

@ -9,7 +9,7 @@
/// @cond
///***************************************************************************
/// Last updated for version 5.9.8
/// Last updated on 2017-09-07
/// Last updated on 2017-09-20
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -100,10 +100,23 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_CRIT_ENTRY_();
QEQueueCtr nFree = m_eQueue.m_nFree; // get volatile into the temporary
// margin available?
if (((margin == QF_NO_MARGIN) && (nFree > static_cast<QEQueueCtr>(0)))
|| (nFree > static_cast<QEQueueCtr>(margin)))
{
if (margin == QF_NO_MARGIN) {
if (nFree > static_cast<QEQueueCtr>(0)) {
status = true; // can post
}
else {
status = false; // cannot post
Q_ERROR_ID(110); // must be able to post the event
}
}
else if (nFree > static_cast<QEQueueCtr>(margin)) {
status = true; // can post
}
else {
status = false; // cannot post
}
if (status) { // can post the event?
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO,
QS::priv_.locFilter[QS::AO_OBJ], this)

View File

@ -9,7 +9,7 @@
/// @cond
///***************************************************************************
/// Last updated for version 5.9.8
/// Last updated on 2017-09-07
/// Last updated on 2017-09-20
///
/// Q u a n t u m L e a P s
/// ---------------------------
@ -100,10 +100,23 @@ bool QActive::post_(QEvt const * const e, uint_fast16_t const margin,
QF_CRIT_ENTRY_();
QEQueueCtr nFree = m_eQueue.m_nFree; // get volatile into the temporary
// margin available?
if (((margin == QF_NO_MARGIN) && (nFree > static_cast<QEQueueCtr>(0)))
|| (nFree > static_cast<QEQueueCtr>(margin)))
{
if (margin == QF_NO_MARGIN) {
if (nFree > static_cast<QEQueueCtr>(0)) {
status = true; // can post
}
else {
status = false; // cannot post
Q_ERROR_ID(110); // must be able to post the event
}
}
else if (nFree > static_cast<QEQueueCtr>(margin)) {
status = true; // can post
}
else {
status = false; // cannot post
}
if (status) { // can post the event?
QS_BEGIN_NOCRIT_(QS_QF_ACTIVE_POST_FIFO,
QS::priv_.locFilter[QS::AO_OBJ], this)