Rule Definition
If a file includes a file that does not have a header extension this either means:
- That naming conventions have not been respected, therefore making it harder to understand the program etc.
- That code is duplicated at several locations breaking the encapsulation rules
Remediation
Either rename the included file (and where it is referenced) or review.
Violation Code Sample
// File1.cpp
#include "file2.cpp" <-- This is incorrect, include the header file!
#include "file3.zzz" <-- This is incorrect, rename the file to .h
Fixed Code Sample
// File1.cpp
#include "file2.h"
#include "file3.h"
Related Technologies
C++
Technical Criterion
Programming Practices - File Organization Conformity
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.