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

[FEATURE] Code quality checks #898

Closed
kvedala opened this issue Jun 24, 2020 · 18 comments · Fixed by #914
Closed

[FEATURE] Code quality checks #898

kvedala opened this issue Jun 24, 2020 · 18 comments · Fixed by #914
Labels
enhancement New feature or request

Comments

@kvedala
Copy link
Collaborator

kvedala commented Jun 24, 2020

Detailed Description

The repo code quality has been quite poor until the introduction of cpplint static code analysis checks.
Even then, there are many instances where the checks have not been enough:

  1. code formatting is not checked by cpplint - introduced clang-format in GitHub actions to atuofix formatting per Google C++ standards Major rework to improve code quality and add automation checks #805
  2. cpplint checks are quite limited and hence a suggestion to use clang-tidy was proposed Should this repo lint C++ code with clang-tidy or cpplint? #808
  3. clang-tidy would be ideal with following important points to note
    • there is no GUI to view the results
    • extensive checks and the repo is not unto the standards and would require more effort to fixing it
    • easy to implement the checks only on modified files to mitigate the above problem
    • the above bandaid fix would again cause the repo to be inconsistently formatted code
  4. LGTM addresses the two as a mid-way solution
    • it performs more stringent checks than cpplint but is more permissive than clang-tidy.
    • The output is presented as a convenient GUI for easy views
    • Ability to post a comment on pull-requests after successful checks
    • List of checks
    • The parent company of LGTM is to become an integral part of GitHub and hence, I believe a proven and credible platform.
  5. There are other tools as discussed in the comments below.

Let us discuss the benefits and drawbacks of such an implementation.

I did create a temporary pull-request for review and discussion #897 (This now seems redundant)

Please review thoroughly and cast your vote on the tool you'd prefer by clicking on that tool below. If selected other, please add a comment mentioning which toll and why.




@kvedala kvedala added the enhancement New feature or request label Jun 24, 2020
@kvedala
Copy link
Collaborator Author

kvedala commented Jun 24, 2020

@kvedala kvedala linked a pull request Jun 24, 2020 that will close this issue
8 tasks
@ayaankhan98
Copy link
Member

can we use Codacy instead of LGTM?

@Panquesito7
Copy link
Member

CodeFactor seems good to me.
It might be a good option.

@mishraabhinn
Copy link
Member

Is lgtm paid ?

@Panquesito7
Copy link
Member

Is LGTM paid ?

No, it's free.

@kvedala
Copy link
Collaborator Author

kvedala commented Jun 24, 2020

can we use Codacy instead of LGTM?

Please elaborate on your points to make your case for the yet another tool.

@kvedala
Copy link
Collaborator Author

kvedala commented Jun 24, 2020

CodeFactor seems good to me.
It might be a good option.

Please elaborate on your points to make your case for the yet another tool.

@Panquesito7
Copy link
Member

Panquesito7 commented Jun 24, 2020

Please elaborate on your points

  • Similar to LGTM.
  • AFAIK, build runs faster than LGTM.
  • Customizable rules.
  • Autofix available.
  • Supports more programming languages such as:
    • Java.
    • C#.
    • Bash.
    • CSS.
    • And many others.
  • Has Slack integration.

@mishraabhinn
Copy link
Member

Continuous code quality and automated code review tools

@kvedala
Copy link
Collaborator Author

kvedala commented Jun 24, 2020

Please elaborate on your points

  • Similar to LGTM.

  • AFAIK, build runs faster than LGTM.

  • Customizable rules.

  • Autofix available.

  • Supports more programming languages such as:

    • Java.
    • C#.
    • Bash.
    • CSS.
    • And many others.
  • Has Slack integration.

  • Probably has other stuff I don't know of.

That's my opinion; I think Code Factor is better than LGTM. 🙂

  • The more-programming languages option is pretty much useless in this repo - This is exclusively for C++
  • CodeFactor This is the current status. so, LGTM is performing more stricter tests than Code Factor.

@ayaankhan98
Copy link
Member

can we use Codacy instead of LGTM?

Please elaborate on your points to make your case for the yet another tool.

codacy is yet another tool which ensures good code standard, With Codacy, we get static analysis, cyclomatic complexity, duplication and code unit test coverage changes in every commit and pull request.
we can use Codacy to enforce your code quality standard, save time in code reviews, enforce best practices, on integrating with repositories we get quality analysis of every pull request.

apart from this i personally used codacy in some of my repositories i liked it, the GUI is pretty good and provides detailed analysis of everything. we can also define our own settings for pull requests and commits that act as thresholds to our work.

@ayaankhan98
Copy link
Member

Earlier i tried to link this repository to codacy but it requires admin permission.

@kvedala
Copy link
Collaborator Author

kvedala commented Jun 24, 2020

Here is my brief understanding

LGTM Codacy
convenient for once-in-a-while contributors not so convenient for once-in-a-while contributors
extremely simple interface for a simple project too many un-necessary options for a simple project
limited number of checks but still quite more than cpplint but less than clang-tidy extensive checks utilizing existing tools like clang-tidy, cpplint, etc
no need for additional configuration needs maintenance and configuration schemes
uses compilation code parameters to analyze code no compilation and hence finds conflicts between unrelated files that are predominant in our repo
there could be downtimes so as here
as was observed recently, the servers could crash and result in delayed responses but since there is no emergency to accept pull-requests, we can live with this issue hoping that GitHub takeover can resolve it in future unknown to me
does not work on forks works on forks

@kvedala
Copy link
Collaborator Author

kvedala commented Jun 24, 2020

Earlier i tried to link this repository to codacy but it requires admin permission.

I linked my fork and tried it out

@ayaankhan98
Copy link
Member

ayaankhan98 commented Jun 24, 2020

Earlier i tried to link this repository to codacy but it requires admin permission.

I linked my fork and tried it out

so what's the decision are we sticking to LGTM or moving to codacy?

codacy have extensive checking criteria if we do not need much extensive checks then we are fine with LGTM, i think so.

@kvedala
Copy link
Collaborator Author

kvedala commented Jun 24, 2020

Earlier i tried to link this repository to codacy but it requires admin permission.

I linked my fork and tried it out

so what's the decision are we sticking to LGTM or moving to codacy?

Lets wait on more feedback from other members as well. There is no rush to decide on one. The LGTM is active for now anyways and serves the purpose without causing any harm. The thread is essentially for a long term commitment and hence needs to be resolved democratically. I alone cannot make a final decision. Needs to be voted upon.

I have added a voting tool in the main issue description for convenience and easy tracking.

@kvedala kvedala added this to In progress in Code Clean-up Jun 26, 2020
@kvedala kvedala linked a pull request Jun 28, 2020 that will close this issue
8 tasks
@kvedala kvedala reopened this Jun 28, 2020
@kvedala
Copy link
Collaborator Author

kvedala commented Jul 8, 2020

After 2 weeks, the majority votes are for LGTM.

@ayaankhan98
Copy link
Member

After 2 weeks, the majority votes are for LGTM.

okay let's keep this repo with LGTM

@kvedala kvedala moved this from In progress to Done in Code Clean-up Jul 21, 2020
@kvedala kvedala closed this as completed Jul 21, 2020
@ayaankhan98 ayaankhan98 removed this from Done in Code Clean-up Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants