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

Tajmahal #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Tajmahal #19

wants to merge 1 commit into from

Conversation

pavel-ignatovich
Copy link

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

Copy link

@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

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

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

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

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

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

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

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

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

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

@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

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

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