Code quality checker

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Jee-Bee
Posts: 1921
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Code quality checker

Postby Jee-Bee » Wed Jun 12, 2019 5:28 pm

Not that i know of

Code: Select all

[quote=bernd user_id=2069]
ping
[/quote]
Works (Don't forgot the user ID).
bernd wrote: ping
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Code quality checker

Postby bernd » Fri Jun 21, 2019 11:45 am

Had a look at this, it finds some problems which are not found by pep8. It's great

https://lgtm.com/projects/g/FreeCAD/Fre ... de=heatmap
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Code quality checker

Postby bernd » Fri Jul 05, 2019 4:08 pm

It seams possible to exclude files from analysis ... https://lgtm.com/help/lgtm/customizing- ... sification

Zhis would make sense for the following file: https://github.com/FreeCAD/FreeCAD/blob ... sign.py#L1

It s autogenerated and has 881 allerts !!! https://lgtm.com/projects/g/FreeCAD/Fre ... de=heatmap
User avatar
saso
Posts: 1279
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Code quality checker

Postby saso » Sat Jul 06, 2019 12:36 pm

I will look in to it when I will try to make it work for C++
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Code quality checker

Postby bernd » Mon Jul 08, 2019 7:51 am

saso wrote:
Sat Jul 06, 2019 12:36 pm
I will look in to it when I will try to make it work for C++
That would be great!

BTW: Path and Fem really reduced lgtm alerts. I found some surprising bugs I would never ever have found without ...
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Code quality checker

Postby bernd » Mon Jul 08, 2019 7:54 am

somehow lgtm is missing files in FEM ...


screen1.png
screen1.png (95.78 KiB) Viewed 172 times

screen2.png
screen2.png (52.99 KiB) Viewed 172 times
User avatar
saso
Posts: 1279
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Code quality checker

Postby saso » Mon Jul 08, 2019 9:10 am

bernd wrote:
Mon Jul 08, 2019 7:51 am
I found some surprising bugs I would never ever have found without ...
Great, this is what this tools are for... There are a few FEM related issues reported also in Coverity, if you maybe want to kill some more bugs ;)
Check the three posts I made here for some basic help on how to use it https://forum.freecadweb.org/viewtopic. ... 30#p210644
bernd wrote:
Mon Jul 08, 2019 7:54 am
somehow lgtm is missing files in FEM ...
There is an "show excluded files" checkbox at the top with some more information about this.
User avatar
bernd
Posts: 8046
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Code quality checker

Postby bernd » Mon Jul 08, 2019 11:04 am

ahh, ok. Would you move these files out of excluded files? They should be analysed as any other file in FEM.
User avatar
saso
Posts: 1279
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Code quality checker

Postby saso » Mon Jul 08, 2019 11:23 am

bernd wrote:
Mon Jul 08, 2019 11:04 am
ahh, ok. Would you move these files out of excluded files? They should be analysed as any other file in FEM.
They are analyzed (check the test files from some other workbenches, they show alerts), they are just excluded from the statistics... I would leave it as it is. https://lgtm.com/help/lgtm/file-classification
User avatar
saso
Posts: 1279
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Code quality checker

Postby saso » Fri Jul 12, 2019 9:49 am

Small update on the LGTM C++ analysis... Unfortunately FreeCAD project is much too big for how the LGTM service is set up currently. A test build timed out after 5h and the build was done only about 38%. So it seems like it will be python only for now.

I have created a pull request for the lgtm analysis configuration file with the file classification for a few generated python files, including the config_control_design.py mentioned by bernd. https://github.com/FreeCAD/FreeCAD/pull/2336