Home > Krazy Code Checker > bundled-apps > koffice > kformula
krazy2 Analysis
Checkers Run = 43
Files Processed = 113
Total Issues = 22
...as of March 15 2010 01:54:29 CET
- For File Type c++
- Check for TRUE and FALSE macros [captruefalse]...okay!
- Check for an acceptable copyright [copyright]...OOPS! 1 issues found!
- flake/FormulaCommandUpdate.h: missing tags
All source files must contain a copyright header which identifies the copyright holder(s) together with a e-mail address that can be used to reach the copyright holder. One copyright holder per line, with real email addresses please. For details regarding KDE's licensing policy please visit http://techbase.kde.org/Policies/Licensing_Policy. A typical copyright looks like: "Copyright 2002,2005-2006 Joe Hacker
" - Check for cpp macros and usage [cpp]...okay!
- Check for code that should be considered crashy. [crashy]...okay!
- Check single-char QString operations for efficiency [doublequote_chars]...OOPS! 4 issues found!
- flake/EncloseElement.cpp: split issues line# 44 (1)
- flake/BasicElement.cpp: line# 434,438,439 (3)
Adding single characters to a QString is faster if the characters are QChars and not QStrings. For example: QString path = oldpath + "/" + base is better written as QString path = oldpath + '/' + base. Same holds for arguments to QString::startsWith(), QString::endsWith(), QString::remove(), QString::section(), and QString::split(). Use QString::remove() instead of QString::replace(foo,"")
- Check for QString compares to "" [emptystrcompare]...okay!
- Check that file ends with a newline [endswithnewline]...okay!
- Check for C++ ctors that should be declared 'explicit' [explicit]...OOPS! 2 issues found!
- flake/UnderOverElement.h: line# 35 (1)
- flake/SubSupElement.h: line# 33 (1)
Make all C++ class constructors that can be used with only one required argument 'explicit' to minimize wrong use of the class. Do this to avoid mistaken implicit constructor ambiguities. Copy constructors should not be explicit.
- Check for foreach loop issues [foreach]...OOPS! 1 issues found!
- flake/BasicElement.cpp: non-const ref iterator line# 204 (1)
When not using POD types (int, double, pointer, ...) you should use const & for your foreach variables. There are two reasons for this: 1) Prevents you from the mistake of writing foreach loops that modify the list, that is 'foreach(Foo f, list) f.a = f.b = f.c = 0;' compiles but does not modify the contents of list 2) Saves a copy constructor call for each of the list elements
- Check validity of i18n calls [i18ncheckarg]...okay!
- Check for invalid icon names [iconnames]...OOPS! 2 issues found!
- flake/KoFormulaTool.cpp: line# 448,455 (2)
Browse available icons with 'kdialog --geticon actions'. Request new icons at http://techbase.kde.org/Projects/Oxygen/Missing_Icons.
- Check for proper include directives [includes]...OOPS! 9 issues found!
- flake/FormulaCursor.cpp: duplicate includes line# 28,31 (2)
- flake/FormulaData.cpp: include own header first line# 22 (1)
- flake/FormulaCommandUpdate.cpp: include own header first line# 21 (1)
- flake/KoFormulaShape.cpp: include own header first line# 22 (1)
- flake/NumberElement.cpp: include own header first line# 23 (1)
- flake/FormulaEditor.cpp: duplicate includes line# 31,34 (2)
- KFormulaPartViewAdaptor.h: missing or improper include guard in header
Use <..> to include installed headers;
to include Qt headers from installed headers; cpp file should include their own headers first (but below config.h); other rules apply, see http://techbase.kde.org/Policies/Library_Code_Policy#Getting_.23includes_right. Use include guards in headers with appropriatedly encoded macro names. - Check for an acceptable license [license]...okay!
- Check for assignments to QString::null [nullstrassign]...okay!
- Check for compares to QString::null or QString() [nullstrcompare]...okay!
- Check for C++ operators that should be 'const' [operators]...okay!
- Check for inappropriate pass-by-value function args [passbyvalue]...okay!
- Check for postfix usage of ++ and -- [postfixop]...OOPS! 1 issues found!
- flake/TokenElement.cpp: line# 233 (1)
You should use ++ and -- as prefix whenever possible as these are more efficient than postfix operators. Prefix increments first and then uses the variable, postfix uses the actual; the variable is incremented as well. Because of this, the prefix operators are inherently more efficient. WARNING Make sure that you don't introduce off-by-one errors when changing i++ to ++i.
- Check for dangerous or inefficient QByteArray usage [qbytearray]...okay!
- Check for Qt classes that should not be used [qclasses]...OOPS! 1 issues found!
- flake/FormulaToolWidget.h: QTabWidget[KTabWidget]
Don't use Qt 4 classes that are deprecated. Additionally make sure to use the KDE version of some Qt GUI elements to provide a consistent look and feel for the KDE desktop. The KDE classes are not just adding functionalities to the Qt base class and are mostly not even based on the Qt class. http://techbase.kde.org/Policies/API_to_Avoid Please refer to the API documentation for details before porting to the K classes.
- Check for Qt methods that should be avoided [qmethods]...okay!
- Check for QMIN and QMAX macros [qminmax]...okay!
- Check for classes that should use the 'Q_OBJECT' macro [qobject]...okay!
- Check for spelling errors [spelling]...okay!
- Check for strings used improperly or should be i18n. [strings]...okay!
- Check for system calls to replace by KDE or Qt equivalents [syscalls]...okay!
- Check for typedefs that should be replaced by Qt typedefs [typedefs]...okay!
- For File Type desktop
- Check that file ends with a newline [endswithnewline]...okay!
- Check for invalid icon names [iconnames]...okay!
- Check for spelling errors [spelling]...okay!
- Validates desktop files using 'desktop-file-validate' [validate]...okay!
- For File Type messages
- Check for appending to rc.cpp [rcappend]...okay!
- For File Type designer
- Check that file ends with a newline [endswithnewline]...okay!
- Check for files that need to be fixed by 'fixuifiles' [fixuifiles]...okay!
- Check validity of i18n calls [i18ncheckarg]...okay!
- Check for Qt classes that should not be used [qclasses]...OOPS! 1 issues found!
- flake/FormulaToolWidget.ui: QTabWidget[KTabWidget]
Don't use Qt 4 classes that are deprecated. Additionally make sure to use the KDE version of some Qt GUI elements to provide a consistent look and feel for the KDE desktop. The KDE classes are not just adding functionalities to the Qt base class and are mostly not even based on the Qt class. http://techbase.kde.org/Policies/API_to_Avoid Please refer to the API documentation for details before porting to the K classes.
- Check for spelling errors [spelling]...okay!
- For File Type tips
- Check that file ends with a newline [endswithnewline]...okay!
- Check for spelling errors [spelling]...okay!
- For File Type kpartgui
- Check that file ends with a newline [endswithnewline]...okay!
- Check validity of i18n calls [i18ncheckarg]...okay!
- Check for spelling errors [spelling]...okay!
- Validates kpartgui files using 'xmllint' [validate]...okay!