Skip to content

Tajmahal#19

Open
pavel-ignatovich wants to merge 1 commit intomasterfrom
cpp_tajmahal
Open

Tajmahal#19
pavel-ignatovich wants to merge 1 commit intomasterfrom
cpp_tajmahal

Conversation

@pavel-ignatovich
Copy link
Copy Markdown

Source code for this PR was taken from following repository: https://github.com/math10/Computer-Graphics-lab

Copy link
Copy Markdown

@monocodus monocodus Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is autogenerated code-style review, new suggestions: 9

#include<bits/stdc++.h>
//}
//{ Loops
#define forab(i,a,b) for (__typeof(b) i = (a); i <= (b); ++i)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define forab(i,a,b) for (__typeof(b) i = (a); i <= (b); ++i)
#define forab(i,a,b) for (__typeof(b) (i) = (a); (i) <= (b); ++(i))

This comment was generated with the following checker: ClangTidy

#define forab(i,a,b) for (__typeof(b) i = (a); i <= (b); ++i)
#define rep(i,n) forab (i, 0, (n) - 1)
#define For(i,n) forab (i, 1, n)
#define rofba(i,a,b) for (__typeof(b) i = (b); i >= (a); --i)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define rofba(i,a,b) for (__typeof(b) i = (b); i >= (a); --i)
#define rofba(i,a,b) for (__typeof(b) (i) = (b); (i) >= (a); --(i))

This comment was generated with the following checker: ClangTidy

#define rofba(i,a,b) for (__typeof(b) i = (b); i >= (a); --i)
#define per(i,n) rofba (i, 0, (n) - 1)
#define rof(i,n) rofba (i, 1, n)
#define forstl(i,s) for (__typeof ((s).end ()) i = (s).begin (); i != (s).end (); ++i)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define forstl(i,s) for (__typeof ((s).end ()) i = (s).begin (); i != (s).end (); ++i)
#define forstl(i,s) for (__typeof ((s).end ()) (i) = (s).begin (); (i) != (s).end (); ++(i))

This comment was generated with the following checker: ClangTidy

#define abs(x) (((x) < 0) ? - (x) : (x))
#define zero(x) (abs (x) < EPS)
#define equal(a,b) (zero ((a) - (b)))
#define PI 2*acos (0.0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define PI 2*acos (0.0)
#define PI (2*acos (0.0))

This comment was generated with the following checker: ClangTidy

#define equal(a,b) (zero ((a) - (b)))
#define PI 2*acos (0.0)
//}
typedef long long int64;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
typedef long long int64;
using int64 = long long;

This comment was generated with the following checker: ClangTidy

#define PI 2*acos (0.0)
//}
typedef long long int64;
typedef unsigned long long int64u;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
typedef unsigned long long int64u;
using int64u = unsigned long long;

This comment was generated with the following checker: ClangTidy

typedef long long int64;
typedef unsigned long long int64u;
#define memo(a,v) memset(a,v,sizeof(a))
#define all(a) a.begin(),a.end()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define all(a) a.begin(),a.end()
#define all(a) a.begin(),(a).end()

This comment was generated with the following checker: ClangTidy

};
}

Image* loadBMP(const char* filename) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too long

loadBMP( const char * filename) now spans 55 lines.
Corresponding modifications started here.
Keep your functions' length within 50 lines to improve readability.

This comment was generated with the following checker: long_method

};
}

Image* loadBMP(const char* filename) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too complicated

loadBMP( const char * filename) now has cyclomatic complexity of 15.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.

This comment was generated with the following checker: high_cyclomatic_complexity

@pavel-ignatovich pavel-ignatovich changed the title tajmahal Tajmahal Jan 12, 2020
Copy link
Copy Markdown

@monocodus monocodus Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is autogenerated code-style review, new suggestions: 2

};
}

Image* loadBMP(const char* filename) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too long

loadBMP( const char * filename) now spans 55 lines.
Corresponding modifications started here.
Keep your functions' length within 50 lines to improve readability.

This comment was generated with the following checker: long_method

};
}

Image* loadBMP(const char* filename) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too complicated

loadBMP( const char * filename) now has cyclomatic complexity of 15.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.

This comment was generated with the following checker: high_cyclomatic_complexity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C/C++ Files in C or C++ Demonstration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant