Home > Krazy Code Checker > bundled-apps > koffice > kspread
krazy2 Analysis
Checkers Run = 46
Files Processed = 538
Total Issues = 169
...as of September 03 2010 02:09:54 CEST
- For File Type c++
- Check for TRUE and FALSE macros [captruefalse]...okay!
- Check for an acceptable copyright [copyright]...okay!
- Check for cpp macros and usage [cpp]...OOPS! 3 issues found!
- kspread_export.h: O/S or Compiler specific macro line# 45,32,64 (3)
C++ source files and non-installed headers should NOT use cpp conditionals that check for a certain O/S or compiler; instead use CMake HAVE_foo macros. We want to check for features discovered during CMake time rather than for a specific O/S.
- Check for code that should be considered crashy. [crashy]...OOPS! 21 issues found!
- shape/TableTool.cpp: line# 236 (1)
- ui/CellToolBase.cpp: line# 1565,2124,2226,2425,2717,2756,2972,2989,3009,3224,3297 (11)
- ui/DragAndDropStrategy.cpp: line# 116 (1)
- ui/CharSelectDia.cpp: line# 117 (1)
- part/View.cpp: line# 1320 (1)
- ProtectableObject.cpp: line# 61,75 (2)
- dialogs/NamedAreaDialog.cpp: line# 149,175 (2)
- dialogs/StyleManagerDialog.cpp: line# 214,245 (2)
Looks for not using QPointers when showing modal dialogs via exec(), as discussed in http://www.kdedevelopers.org/node/3919
- Check single-char QString operations for efficiency [doublequote_chars]...OOPS! 5 issues found!
- Sheet.cpp: line# 2423 (1)
- Sheet.cpp: split issues line# 1557 (1)
- GenValidationStyle.cpp: split issues line# 95 (1)
- ValueFormatter.cpp: line# 318 (1)
- ValueFormatter.cpp: starts/endsWith issues line# 317 (1)
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 unwanted doxygen tags in major versions [doxytags]...okay!
- 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! 3 issues found!
- commands/StyleStorageUndoCommand.h: line# 48 (1)
- ui/LocationComboBox.h: line# 47 (1)
- BindingModel.h: line# 40 (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! 14 issues found!
- commands/AutoFillCommand.cpp: non-const ref iterator line# 526,566 (2)
- DependencyManager.cpp: non-const ref iterator line# 66,72 (2)
- DependencyManager.cpp: values or keys iteration line# 58,72 (2)
- plugins/solver/Solver.cpp: non-const ref iterator line# 141 (1)
- plugins/scripting/ScriptingWidgets.cpp: non-const ref iterator line# 113 (1)
- plugins/scripting/ScriptingPart.cpp: non-const ref iterator line# 61,79 (2)
- part/Doc.cpp: values or keys iteration line# 155 (1)
- part/dialogs/SheetSelectPage.cpp: non-const ref iterator line# 113 (1)
- StyleManager.cpp: non-const ref iterator line# 427 (1)
- StyleManager.cpp: values or keys iteration line# 427 (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! 10 issues found!
- shape/TableTool.cpp: line# 269 (1)
- ui/CellToolBase.cpp: line# 504,510,544,770,815 (5)
- ui/CellToolBase_p.cpp: line# 1267,1291,1295 (3)
- dialogs/LinkDialog.cpp: line# 154 (1)
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! 35 issues found!
- functions/math.cpp: include own header first line# 29 (1)
- SheetPrint_p.cpp: include own header first line# 24 (1)
- part/View.cpp: duplicate includes line# 49,57 (2)
- tests/BenchmarkCluster.cpp: include own header first line# 24 (1)
- tests/TestDatetimeFunctions.h: do not include QtModules line# 23 (1)
- tests/TestKspreadCommon.h: missing or improper include guard in header
- tests/BenchmarkRTree.h: missing or improper include guard in header
- tests/TestFormula.h: do not include QtModules line# 23 (1)
- tests/TestPointStorage.h: missing or improper include guard in header
- tests/TestBitopsFunctions.h: do not include QtModules line# 23 (1)
- tests/TestValue.h: do not include QtModules line# 23 (1)
- tests/TestSheet.h: missing or improper include guard in header
- tests/TestDatabaseFunctions.h: do not include QtModules line# 23 (1)
- tests/TestTrigFunctions.h: do not include QtModules line# 23 (1)
- tests/TestFinancialFunctions.h: do not include QtModules line# 24 (1)
- tests/BenchmarkPointStorage.h: missing or improper include guard in header
- tests/BenchmarkPointStorage.h: do not include QtModules line# 23 (1)
- tests/BenchmarkCluster.h: missing or improper include guard in header
- tests/BenchmarkCluster.h: do not include QtModules line# 23 (1)
- tests/TestPointStorage.cpp: include own header first line# 25 (1)
- tests/TestMathFunctions.h: do not include QtModules line# 24 (1)
- tests/TestEngineeringFunctions.h: do not include QtModules line# 24 (1)
- tests/TestTextFunctions.h: do not include QtModules line# 23 (1)
- tests/TestInformationFunctions.cpp: include own header first line# 28 (1)
- tests/TestLogicFunctions.h: do not include QtModules line# 23 (1)
- tests/TestInformationFunctions.h: do not include QtModules line# 24 (1)
- tests/TestDependencies.h: do not include QtModules line# 23 (1)
- tests/TestRTree.cpp: include own header first line# 5 (1)
- tests/TestStatisticalFunctions.h: do not include QtModules line# 24 (1)
- tests/TestRegion.h: do not include QtModules line# 23 (1)
- tests/TestValueFormatter.h: do not include QtModules line# 23 (1)
- tests/TestOpenFormula.h: do not include QtModules line# 25 (1)
- tests/BenchmarkPointStorage.cpp: include own header first line# 26 (1)
- SheetAccessModel.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]...OOPS! 3 issues found!
- part/CanvasBase.cpp: missing license
- tests/TestRTree.cpp: missing license
- tests/TestRTree.h: missing license
Each source file must contain a license or a reference to a license which states under which terms the software may be used, modified and redistributed. For details regarding KDE's licensing policy please visit http://techbase.kde.org/Policies/Licensing_Policy.
- 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]...OOPS! 2 issues found!
Make sure all public C++ class comparison operators are const.
- Check for inappropriate pass-by-value function args [passbyvalue]...okay!
- Check for postfix usage of ++ and -- [postfixop]...OOPS! 21 issues found!
- commands/AutoFillCommand.cpp: line# 731,749,767,787 (4)
- ui/CellToolBase.cpp: line# 2615 (1)
- functions/statistical.cpp: line# 573,2212 (2)
- functions/financial.cpp: line# 734 (1)
- part/Digest.cpp: line# 261 (1)
- tests/TestValue.cpp: line# 140,141,142,162,163,164,179,247,248,253 (10)
- Cell.cpp: line# 300 (1)
- ValueCalc.cpp: line# 1437 (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! 4 issues found!
- ui/RegionSelector.cpp: QDialog[KDialog],QDialog[KDialog]
- ui/FormulaEditorHighlighter.cpp: QTextEdit[KTextEdit],QTextEdit[KTextEdit]
- ui/RegionSelector.h: QDialog[KDialog]
- ui/FormulaEditorHighlighter.h: QTextEdit[KTextEdit]
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]...OOPS! 1 issues found!
- chart/ChartDatabaseSelectorFactory.h: line# 35 (1)
QObject derived classes should use the Q_OBJECT macro.
- Check for spelling errors [spelling]...OOPS! 18 issues found!
- ProtectableObject.h: line# 36[[wether]] (1)
- Util.h: line# 54[[expresion]] (1)
- commands/PasteCommand.h: line# 70[[wether]],71[[wether]] (2)
- Region.cpp: line# 1041[[charakter]] (1)
- ui/CellView.cpp: line# 2095[[allignment]] (1)
- ui/SheetView.cpp: line# 197[[splitted]] (1)
- ui/CellToolOptionWidget.cpp: line# 141[[existance]] (1)
- tests/TestInformationFunctions.cpp: line# 256[[propogate]] (1)
- tests/TestFinancialFunctions.cpp: line# 853[[superflous]] (1)
- tests/TestLogicFunctions.cpp: line# 72[[propogate]],144[[propogate]],187[[propogate]] (3)
- Formula.h: line# 372[[occurences]] (1)
- Selection.cpp: line# 409[[occurences]] (1)
- FunctionModule.h: line# 68[[wether]] (1)
- dialogs/LinkDialog.cpp: line# 82[[internet]] (1)
- Selection.h: line# 195[[occurence]] (1)
Spelling errors in comments and strings should be fixed as they may show up later in API documentation, handbooks, etc. Misspelled strings make the translator's job harder. Please use US English.
- Check for strings used improperly or should be i18n. [strings]...OOPS! 28 issues found!
- functions/engineering.cpp: QLatin1String issues line# 553 (1)
- Util.cpp: QLatin1String issues line# 497,501,505 (3)
- part/Headers.cpp: QLatin1String issues line# 533,1168,1237 (3)
- Cell.cpp: QLatin1String issues line# 2041 (1)
- dialogs/LinkDialog.cpp: QLatin1String issues line# 254,260,266,272,284,286 (6)
- ValueCalc.cpp: QLatin1String issues line# 2169,2172,2175,2178 (4)
- Style.cpp: QLatin1String issues line# 697,699,701,703,705,707,709,711,713 (9)
- ValueFormatter.cpp: QLatin1String issues line# 317 (1)
Some QString methods (like startsWith() and endsWith()) are more efficient if they are passed a QLatin1String, avoiding an implicit conversion from const char *.
- 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 kconfigxt
- Check that file ends with a newline [endswithnewline]...okay!
- Check validity of i18n calls [i18ncheckarg]...okay!
- Check for spelling errors [spelling]...okay!
- Validates KConfigXT files using 'xmllint' [validate]...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!
- plugins/scripting/scripts/csvoptions.ui: QComboBox[KComboBox],QComboBox[KComboBox],QComboBox[KComboBox],QComboBox[KComboBox]
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 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!