|
| 1 | ++++ |
| 2 | +title = "Code Quality" |
| 3 | +description = "Ensuring good overall code quality." |
| 4 | +date = 2021-05-01T18:20:00+00:00 |
| 5 | +updated = 2021-05-01T18:20:00+00:00 |
| 6 | +draft = false |
| 7 | +weight = 420 |
| 8 | +sort_by = "weight" |
| 9 | +template = "docs/page.html" |
| 10 | + |
| 11 | +[extra] |
| 12 | +lead = "Ensuring good overall code quality." |
| 13 | +toc = true |
| 14 | +top = false |
| 15 | ++++ |
| 16 | +### Introduction ### |
| 17 | + |
| 18 | +> I insist on code quality — Allen |
| 19 | +
|
| 20 | +This means: |
| 21 | + |
| 22 | +1. No build failures on supported platforms (obviously including our [Continuous Integration ("CI") systems](https://travis-ci.org/libical/libical)) |
| 23 | +2. No compiler warnings allowed using "strict" (strict being a relative term) compiler warning options |
| 24 | +3. No [splint](http://www.splint.org) issues using -weak checking |
| 25 | +4. No serious [Coverity Scan](http://scan.coverity.com) issues |
| 26 | +5. No serious [scan-build](http://clang-analyzer.llvm.org/scan-build.html) issues |
| 27 | +6. No [Krazy](https://github.com/Krazy-collection/krazy) issues |
| 28 | +7. No failed regression tests |
| 29 | +8. Coding Style is very strictly enforced |
| 30 | +9. (A goal) API documentation must be complete |
| 31 | +10. Each source file must have a proper license and copyright header (Krazy tests for this) |
| 32 | +11. Other stuff as I think of it |
| 33 | + |
| 34 | +We want to be as portable as possible. We welcome ports to platforms we haven't encountered previously. |
| 35 | + |
| 36 | +#### Compiler Warnings #### |
| 37 | + |
| 38 | +See the top-level CMakeLists.txt for the options we use for each compiler. Expect those options to get stricter over time. Feel free to suggest compiler options that increase our code quality. |
| 39 | + |
| 40 | +#### Continuous Integration #### |
| 41 | + |
| 42 | +We use [Travis](https://travis-ci.org/libical/libical) to perform CI for libical on Linux and OSX. |
| 43 | +For Windows we use the [Appveyor](https://ci.appveyor.com/project/winterz/libical) CI |
| 44 | + |
| 45 | +#### Lint Checking #### |
| 46 | + |
| 47 | +We use [Splint](https://www.splint.org) for lint checking our source code. I'd love to have lint-checking as part of the CI reporting, but until then we run it by hand and fix the issues as part of the pre-release checklist. |
| 48 | + |
| 49 | +#### Static Analysis #### |
| 50 | + |
| 51 | +We're grateful to the good folks at [Coverity](https://coverity.com) for giving the FOSS world free access to their wonderful static analysis tool, Coverity Scan. As a goal, I'd like to get the number of Coverity Scan issues down to zero. It might take a few major releases to get there. |
| 52 | + |
| 53 | +[scan-build](http://clang-analyzer.llvm.org/scan-build.html) is also good for static analysis checking but I've seen quite some false positives. Good for a free tool, however. |
| 54 | + |
| 55 | +By the way, [cppcheck](http://cppcheck.sourceforge.net) is another tool I like for static code analysis. Occasionally we should run cppcheck as well. |
| 56 | + |
| 57 | +#### Krazy Analysis #### |
| 58 | + |
| 59 | +[Krazy](https://github.com/Krazy-collection/krazy) is another static analysis tool, but it checks mostly for non-C specific stuff, like it ensures Copyrights and License headers, looks for spelling mistakes and also coding style problems. We must be 100% "Krazy clean". |
| 60 | + |
| 61 | +#### Coding Style #### |
| 62 | + |
| 63 | +[Coding Style](@/docs/contributing/coding-style.md) is enforced. |
| 64 | + |
| 65 | +#### API Documentation #### |
| 66 | + |
| 67 | +We use [Doxygen](http://www.doxygen.org) to generate our [API Documentation](@/docs/developer/libical.md) and put the result on our [GitHub provided webspace](http://libical.github.io). At this time our API Documentation is horrible and needs a lot of attention (see [libical#175](https://github.com/libical/libical/issues/175)), so one of our long term goals is to get the API Documentation into shape with full coverage. |
| 68 | + |
0 commit comments