D22097: Syntax correction in src/backend/hypothesisTest/

Alexander Semke noreply at phabricator.kde.org
Wed Jun 26 15:55:37 BST 2019


asemke added inline comments.

INLINE COMMENTS

> HypothesisTest.cpp:173
> +
> +	for (auto* col : dataSourceSpreadsheet->children<Column>()) {
> +		all_columns << col->name();

no brackets for one-liners.

> HypothesisTest.cpp:225
> +	} else {
> +		QMap<QString, int> col_name;
> +		QString base_col_name = "";

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

> HypothesisTest.cpp:226
> +		QMap<QString, int> col_name;
> +		QString base_col_name = "";
> +		int np;

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

> HypothesisTest.cpp:330
> +	if (m_columns.size() != 2) {
> +		printError("Inappropriate number of columns selected");
> +		emit q->changed();

no i18n here and below in other printError calls?

> HypothesisTest.cpp:498
> +	int* ni = new int[np];
> +	double* sum = new double[np];
> +	double* mean = new double[np];

where are the deletes for these arrays?

> HypothesisTest.cpp:566
> +
> +	m_stats_table = i18n( "<h3>Group Summary Statistics</h3>");
> +

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

> HypothesisTest.cpp:579
> +
> +	row_major[0] = ""; row_major[1] = "Between Groups"; row_major[2] = "Within Groups";
> +

i18n?

> HypothesisTest.cpp:582
> +	int base_index = 0;
> +	base_index = 1 * column_count; row_major[base_index + 0] = "Sum of Squares";	row_major[base_index + 1] = s_b;	row_major[base_index + 2] = s_w;
> +	base_index = 2 * column_count; row_major[base_index + 0] = "Degree of Freedom"; row_major[base_index + 1] = f_b;	row_major[base_index + 2] = f_w;

i18n?

> HypothesisTest.cpp:641
> +
> +	double* yi_bar = new double[np];
> +	double* zi_bar = new double[np];

where are the deletes for these arrays?

> HypothesisTestPrivate.h:39
> +
> +        explicit HypothesisTestPrivate(HypothesisTest*);
> +        virtual ~HypothesisTestPrivate();

one tab too much here?

> HypothesisTestPrivate.h:58
> +        Spreadsheet* dataSourceSpreadsheet{nullptr};
> +        QVector<Column*> m_columns;
> +        QStringList all_columns;

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

> HypothesisTestPrivate.h:81
> +
> +		QString getLine(const QString& msg, const QString& color = "black");
> +		void printLine(const int& index, const QString& msg, const QString& color = "black");

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

> HypothesisTestPrivate.h:84
> +		void printError(const QString& error_msg);
> +        void clearTestView();
> +};

wrong indentation here.

REPOSITORY
  R262 LabPlot

REVISION DETAIL
  https://phabricator.kde.org/D22097

To: devanshuagarwal, asemke, sgerlach
Cc: sgerlach, kde-edu, asemke, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20190626/e407235e/attachment-0001.html>


More information about the kde-edu mailing list