Syntax correction in src/backend/hypothesisTest/
ClosedPublic

Authored by devanshuagarwal on Jun 25 2019, 6:50 PM.

Details

Reviewers
asemke
sgerlach
Summary

I have tried to follow the coding style guide "coding_style.dox" for all files in backend/hypothesisTest
Please see if it now somewhat fits in required coding style and what all changes needs to be done

After getting feedbacks and suggestions, I will try to correct coding styles in my other added files.

Diff Detail

Repository
R262 LabPlot
Lint
Lint Skipped
Unit
Unit Tests Skipped
Restricted Application added a project: KDE Edu. · View Herald TranscriptJun 25 2019, 6:50 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
devanshuagarwal requested review of this revision.Jun 25 2019, 6:50 PM
asemke added inline comments.Jun 26 2019, 2:55 PM
hypothesisTest/HypothesisTest.cpp
173

no brackets for one-liners.

225

we use camel case naming convention except of the C-code in NSL. So, colName, etc.

226

no need for an extra assignment. The string is initialized as an empty string.

330

no i18n here and below in other printError calls?

498

where are the deletes for these arrays?

566

put h3 tags outside of the i18n call here and in other similar places in the code.

579

i18n?

582

i18n?

641

where are the deletes for these arrays?

hypothesisTest/HypothesisTestPrivate.h
39

one tab too much here?

58

all m_* are private and should be part of the private section.

81

why not to use Qt::GlobalColors instead of QString for the color?

84

wrong indentation here.

sgerlach added inline comments.Jun 26 2019, 3:15 PM
hypothesisTest/HypothesisTest.cpp
61

no brackets for one-liners

196

define variables just before you need them

279

why qSqrt and not sqrt from cmath?

321

define variables just before use

858

too many parantheses

903

too many parantheses

devanshuagarwal marked 8 inline comments as done.Jun 26 2019, 5:44 PM
devanshuagarwal added inline comments.
hypothesisTest/HypothesisTest.cpp
279

How to decide which to use ? qSqrt or sqrt?

330

printError function calls printLine function which inturn calls getLine function and getLine function converts message to i18n string

This is implementation of getLine function:

QString HypothesisTestPrivate::getLine(const QString& msg, const QString& color) {
	return i18n("<p style=color:%1;>%2</p>", color, msg);
}
498

Now, I have added deletes for every memory allocation with new keyword

566

does i18n will try to translate these tags along with other content or will it recognize these tags?

579

It is there in function implementation of getHtmlTable

582

getHtmlTable make use of i18n.

hypothesisTest/HypothesisTestPrivate.h
58

will m_* will be done for private functions or only for variables?

devanshuagarwal marked an inline comment as done.Jun 26 2019, 6:28 PM
sgerlach added inline comments.Jun 26 2019, 8:10 PM
hypothesisTest/HypothesisTest.cpp
279

I would suggest to always choose the function with the minimum requirements. So C/C++ before GSL before Qt. This may not be always consistent right now, but most of time it ensures less conflicts and best portability.

devanshuagarwal marked 18 inline comments as done.Aug 11 2019, 6:42 PM
devanshuagarwal marked an inline comment as not done.Aug 11 2019, 6:46 PM
devanshuagarwal added inline comments.
hypothesisTest/HypothesisTestPrivate.h
81

I am using this color variable in Html

	 "<p style=color:" + color + ";>" + i18n("%1", msg) + "</p>"

Hence, I thing QString would be best choice

devanshuagarwal marked an inline comment as not done.Aug 16 2019, 1:58 PM
sgerlach accepted this revision.Aug 20 2019, 7:16 AM
This revision is now accepted and ready to land.Aug 20 2019, 7:16 AM
sgerlach closed this revision.Aug 29 2019, 3:35 PM