New Defects reported by Coverity Scan for rhabacker/umbrello
scan-admin at coverity.com
scan-admin at coverity.com
Sat Sep 6 00:41:47 BST 2025
Hi,
Please find the latest report on new defect(s) introduced to rhabacker/umbrello found with Coverity Scan.
133 new defect(s) introduced to rhabacker/umbrello found with Coverity Scan.
12 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 20 of 133 defect(s)
** CID 894378: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
_____________________________________________________________________________________________
*** CID 894378: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/lib/cppparser/driver.cpp: 350 in Driver::ParseHelper::parse()()
344 TranslationUnitAST::Node unit;
345 parser.parseTranslationUnit(unit);
346 m_driver->m_currentParsedFile->setTranslationUnit(unit);
347 m_driver->m_parsedUnits.insert(m_fileName, m_driver->m_currentParsedFile);
348 m_driver->fileParsed(*m_driver->m_currentParsedFile);
349
>>> CID 894378: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "lf" is copied in call to copy assignment for class "CachedLexedFilePointer", when it could be moved instead.
350 m_driver->m_currentLexerCache = lf;
351
352 m_driver->m_currentMasterFileName = oldMasterFileName;
353 }
354
355 ParsedFilePointer parsedFile() const
** CID 894377: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/finder/umlscenefinder.cpp: 93 in UMLSceneFinder::showItem(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894377: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/finder/umlscenefinder.cpp: 93 in UMLSceneFinder::showItem(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
87 return false;
88
89 UMLScene *scene = view->umlScene();
90 if (!scene)
91 return false;
92
>>> CID 894377: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "findWidget", when it could be moved instead.
93 UMLWidget *w = scene->findWidget(id);
94 if (!w)
95 return false;
96
97 scene->setIsOpen(true);
98 view->setZoom(100);
** CID 894376: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umldoc.cpp: 1578 in UMLDoc::createDiagram(UMLFolder *, Uml::DiagramType::Enum, const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894376: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umldoc.cpp: 1578 in UMLDoc::createDiagram(UMLFolder *, Uml::DiagramType::Enum, const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
1572 view->umlScene()->setType(type);
1573 view->umlScene()->setID(id);
1574 addView(view);
1575 Q_EMIT sigDiagramCreated(id);
1576 setModified(true);
1577 UMLApp::app()->enablePrint(true);
>>> CID 894376: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "changeCurrentView", when it could be moved instead.
1578 changeCurrentView(id);
1579 return view;
1580 }
1581 return nullptr;
1582 }
1583
** CID 894375: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/widgetbase.cpp: 234 in WidgetBase::setLocalID(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894375: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/widgetbase.cpp: 234 in WidgetBase::setLocalID(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
228 * Sets the local id of the object.
229 *
230 * @param id The local id of the object.
231 */
232 void WidgetBase::setLocalID(Uml::ID::Type id)
233 {
>>> CID 894375: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is copied in call to copy assignment for class "Uml::ID::Type", when it could be moved instead.
234 m_nLocalID = id;
235 }
236
237 /**
238 * Returns the local ID for this object. This ID is used so that
239 * many objects of the same @ref UMLObject instance can be on the
** CID 894374: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/uniqueconstraint.cpp: 29 in UMLUniqueConstraint::UMLUniqueConstraint(UMLObject *, const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894374: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/uniqueconstraint.cpp: 29 in UMLUniqueConstraint::UMLUniqueConstraint(UMLObject *, const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
23 *
24 * @param parent The parent of this UMLUniqueConstraint.
25 * @param name The name of this UMLUniqueConstraint.
26 * @param id The unique id given to this UMLUniqueConstraint.
27 */
28 UMLUniqueConstraint::UMLUniqueConstraint(UMLObject *parent, const QString& name, Uml::ID::Type id)
>>> CID 894374: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "UMLEntityConstraint", when it could be moved instead.
29 : UMLEntityConstraint(parent, name, id)
30 {
31 init();
32 }
33
34 /**
** CID 894373: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umllistview.cpp: 2511 in UMLListView::loadChildrenFromXMI(UMLListViewItem *, QDomElement &)()
_____________________________________________________________________________________________
*** CID 894373: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umllistview.cpp: 2511 in UMLListView::loadChildrenFromXMI(UMLListViewItem *, QDomElement &)()
2505 IDChangeLog *idchanges = m_doc->changeLog();
2506 if (idchanges) {
2507 Uml::ID::Type newID = idchanges->findNewID(nID);
2508 if (newID != Uml::ID::None) {
2509 logDebug2("UMLListView::loadChildrenFromXMI using id %1 instead of %2",
2510 Uml::ID::toString(newID), Uml::ID::toString(nID));
>>> CID 894373: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "newID" is copied in call to copy assignment for class "Uml::ID::Type", when it could be moved instead.
2511 nID = newID;
2512 }
2513 }
2514 /************ End of hack for copy/paste code ************/
2515
2516 UMLObject *pObject = m_doc->findObjectById(nID);
** CID 894372: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/messagewidget.cpp: 85 in MessageWidget::MessageWidget(UMLScene *, Uml::SequenceMessage::Enum, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894372: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/messagewidget.cpp: 85 in MessageWidget::MessageWidget(UMLScene *, Uml::SequenceMessage::Enum, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
79 * @param scene The parent to this class.
80 * @param seqMsgType The Uml::SequenceMessage::Enum of this message widget
81 * @param id The ID to assign (-1 will prompt a new ID.)
82 */
83 MessageWidget::MessageWidget(UMLScene * scene, Uml::SequenceMessage::Enum seqMsgType,
84 Uml::ID::Type id)
>>> CID 894372: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "UMLWidget", when it could be moved instead.
85 : UMLWidget(scene, WidgetBase::wt_Message, id)
86 {
87 init();
88 m_sequenceMessageType = seqMsgType;
89 }
90
** CID 894504: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umldoc.cpp: 959 in UMLDoc::findObjectById(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894504: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umldoc.cpp: 959 in UMLDoc::findObjectById(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
953 }
954 o = m_root[i]->findObjectById(id);
955 if (o) {
956 return o;
957 }
958 }
>>> CID 894504: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "findStereotypeById", when it could be moved instead.
959 o = findStereotypeById(id);
960 return o;
961 }
962
963 /**
964 * Used to find a @ref UMLObject by its type and name.
** CID 894503: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umldoc.cpp: 3245 in UMLDoc::addUMLView(UMLView *)()
_____________________________________________________________________________________________
*** CID 894503: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umldoc.cpp: 3245 in UMLDoc::addUMLView(UMLView *)()
3239 name = viewName + QLatin1Char('_') + QString::number(++i);
3240 }
3241 if (i) { //If name was modified
3242 pView->umlScene()->setName(name);
3243 }
3244
>>> CID 894503: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "oldID" is passed-by-value as parameter to "assignNewID", when it could be moved instead.
3245 Uml::ID::Type newID = assignNewID(oldID);
3246 pView->umlScene()->setID(newID);
3247
3248 pView->umlScene()->activateAfterLoad(true);
3249 pView->umlScene()->endPartialWidgetPaste();
3250 pView->umlScene()->setOptionState(Settings::optionState());
** CID 894502: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umldoc.cpp: 1748 in UMLDoc::removeDiagramCmd(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894502: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umldoc.cpp: 1748 in UMLDoc::removeDiagramCmd(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
1742 if (!umlview) {
1743 logError1("UMLDoc::removeDiagramCmd : diagram with id %1 not found", Uml::ID::toString(id));
1744 return;
1745 }
1746
1747 removeView(umlview);
>>> CID 894502: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "sigDiagramRemoved", when it could be moved instead.
1748 Q_EMIT sigDiagramRemoved(id);
1749 setModified(true);
1750 }
1751
1752 /**
1753 * Return the currently selected root folder.
** CID 894501: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/signalwidget.cpp: 40 in SignalWidget::SignalWidget(UMLScene *, SignalWidget::SignalType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894501: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/signalwidget.cpp: 40 in SignalWidget::SignalWidget(UMLScene *, SignalWidget::SignalType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
34 *
35 * @param scene The parent of the widget.
36 * @param signalType The type of Signal.
37 * @param id The ID to assign (-1 will prompt a new ID.)
38 */
39 SignalWidget::SignalWidget(UMLScene *scene, SignalType signalType, Uml::ID::Type id)
>>> CID 894501: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "UMLWidget", when it could be moved instead.
40 : UMLWidget(scene, WidgetBase::wt_Signal, id),
41 m_oldX(0),
42 m_oldY(0)
43 {
44 m_signalType = signalType;
45 m_pName = nullptr;
** CID 894500: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/actor.cpp: 15 in UMLActor::UMLActor(const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894500: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/actor.cpp: 15 in UMLActor::UMLActor(const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
9 * Constructs an Actor.
10 *
11 * @param name The name of the Actor.
12 * @param id The unique id to assign to this Actor.
13 */
14 UMLActor::UMLActor(const QString & name, Uml::ID::Type id)
>>> CID 894500: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "UMLCanvasObject", when it could be moved instead.
15 : UMLCanvasObject(name, id)
16 {
17 init();
18 }
19
20 /**
** CID 894499: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/foreignkeyconstraint.cpp: 29 in UMLForeignKeyConstraint::UMLForeignKeyConstraint(UMLObject *, const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894499: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/foreignkeyconstraint.cpp: 29 in UMLForeignKeyConstraint::UMLForeignKeyConstraint(UMLObject *, const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
23 * @param parent The parent of this UMLForeignKeyConstraint.
24 * @param name The name of this UMLForeignKeyConstraint.
25 * @param id The unique id given to this UMLForeignKeyConstraint.
26 */
27 UMLForeignKeyConstraint::UMLForeignKeyConstraint(UMLObject *parent,
28 const QString& name, Uml::ID::Type id)
>>> CID 894499: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "UMLEntityConstraint", when it could be moved instead.
29 : UMLEntityConstraint(parent, name, id)
30 {
31 init();
32 }
33
34 /**
** CID 894498: (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1160 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1218 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1077 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 757 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 802 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 754 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1152 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 719 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1106 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 808 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 769 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 728 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1197 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
_____________________________________________________________________________________________
*** CID 894498: (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1160 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
1154 // dt == Uml::DiagramType::State
1155 StateWidget::StateType type = StateWidget::StateType::Normal;
1156 if (isInitial)
1157 type = StateWidget::StateType::Initial;
1158 else if (isEnd)
1159 type = StateWidget::StateType::End;
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "StateWidget", when it could be moved instead.
1160 w = new StateWidget(view->umlScene(), type, id);
1161 }
1162 width = w->width();
1163 height = w->height();
1164 const bool isNormal = (!isInitial && !isEnd);
1165 if (isNormal) {
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1218 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
1212 // line_color 3342489
1213 // fill_color 13434879
1214 // quidu "4385B29C023B"
1215 // autoResize TRUE)
1216 QString idStr = quidu(attr);
1217 Uml::ID::Type id = Uml::ID::fromString(idStr);
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "ActivityWidget", when it could be moved instead.
1218 w = new ActivityWidget(view->umlScene(), ActivityWidget::ActivityType::Branch, id);
1219 width = height = 40.0;
1220 w->setSize(width, height);
1221 if (!name.isEmpty() && !name.startsWith(QStringLiteral("$UNNAMED$")))
1222 w->setName(name);
1223 } else if (objType == QStringLiteral("SynchronizationView")) {
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1077 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
1071 height = 880; // initial guess, will be adjusted after loading (see UMLWidgetList swimlanes)
1072 // (object Swimlane "Operator" @627
1073 // location (2716, 0) // optional, if missing it's the first (leftmost)
1074 // line_color 3342489
1075 // quidu "3ADE7D250155"
1076 // width 980)
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "BoxWidget", when it could be moved instead.
1077 w = new BoxWidget(view->umlScene(), id);
1078 w->setSize(width, height);
1079 QPointF pos = fetchLocation(attr, 0.0, 0.0); // use 0 for width and height
1080 if (pos.isNull()) {
1081 pos = QPointF(1.0, 1.0);
1082 } else {
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 757 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
751 UMLObject *o = nullptr;
752 if (stereotype == QStringLiteral("Actor")) {
753 o = Object_Factory::createUMLObject(UMLObject::ot_Actor, name, parentPkg, false);
754 o->setID(id);
755 } else if (stereotype.contains(QStringLiteral("enum"), Qt::CaseInsensitive)) {
756 o = Object_Factory::createUMLObject(UMLObject::ot_Enum, name, parentPkg, false);
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "setID", when it could be moved instead.
757 o->setID(id);
758 UMLEnum *e = o->asUMLEnum();
759 // set stereotype
760 if (stereotype.compare(QStringLiteral("enumeration"), Qt::CaseInsensitive) &&
761 stereotype.compare(QStringLiteral("enum"), Qt::CaseInsensitive) ) {
762 e->setStereotypeCmd(stereotype);
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 802 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
796 }
797 o->setDoc(node->documentation());
798 parentPkg->addObject(o);
799
800 } else if (objType == QStringLiteral("UseCase")) {
801 UMLObject *o = Object_Factory::createUMLObject(UMLObject::ot_UseCase, name, parentPkg, false);
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "setID", when it could be moved instead.
802 o->setID(id);
803 o->setDoc(node->documentation());
804 parentPkg->addObject(o);
805
806 } else if (objType == QStringLiteral("Component") || objType == QStringLiteral("module")) {
807 UMLObject *o = Object_Factory::createUMLObject(UMLObject::ot_Component, name, parentPkg, false);
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 754 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
748
749 } else if (objType == QStringLiteral("Class")) {
750 QString stereotype = clean(node->findAttribute(QStringLiteral("stereotype")).string);
751 UMLObject *o = nullptr;
752 if (stereotype == QStringLiteral("Actor")) {
753 o = Object_Factory::createUMLObject(UMLObject::ot_Actor, name, parentPkg, false);
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "setID", when it could be moved instead.
754 o->setID(id);
755 } else if (stereotype.contains(QStringLiteral("enum"), Qt::CaseInsensitive)) {
756 o = Object_Factory::createUMLObject(UMLObject::ot_Enum, name, parentPkg, false);
757 o->setID(id);
758 UMLEnum *e = o->asUMLEnum();
759 // set stereotype
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1152 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
1146 if (dt == Uml::DiagramType::Activity) {
1147 ActivityWidget::ActivityType type = ActivityWidget::ActivityType::Normal;
1148 if (isInitial)
1149 type = ActivityWidget::ActivityType::Initial;
1150 else if (isEnd)
1151 type = ActivityWidget::ActivityType::End;
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "ActivityWidget", when it could be moved instead.
1152 w = new ActivityWidget(view->umlScene(), type, id);
1153 } else {
1154 // dt == Uml::DiagramType::State
1155 StateWidget::StateType type = StateWidget::StateType::Normal;
1156 if (isInitial)
1157 type = StateWidget::StateType::Initial;
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 719 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
713 pratts = pres->attributes();
714 }
715 UMLObject::ObjectType containerType = UMLObject::ot_Package;
716 if (!pratts.isEmpty() || statemachine)
717 containerType = UMLObject::ot_Folder;
718 o = Object_Factory::createUMLObject(containerType, name, parentPkg);
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "setID", when it could be moved instead.
719 o->setID(id);
720 UMLPackage *localParent = o->asUMLPackage();
721 for (int i = 0; i < atts.count(); ++i) {
722 umbrellify(atts[i].second.node, localParent);
723 }
724 for (int i = 0; i < pratts.count(); ++i) {
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1106 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
1100 logDebug3("umbrellify(Swimlane %1) : textW width=%2 , height=%3", name, textW->width(), textW->height());
1101 view->umlScene()->setupNewWidget(textW, false);
1102 w = nullptr; // Setup of `w` is all done, setting it to null to inform the code below.
1103 } else if (objType == QStringLiteral("ActivityStateView")) {
1104 QString idStr = quidu(attr);
1105 Uml::ID::Type id = Uml::ID::fromString(idStr);
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "ActivityWidget", when it could be moved instead.
1106 w = new ActivityWidget(view->umlScene(), ActivityWidget::ActivityType::Normal, id);
1107 width = fetchDouble(attr, QStringLiteral("width"));
1108 if (qFuzzyIsNull(width)) {
1109 width = 50.0 + (name.length() * 12);
1110 }
1111 height = fetchDouble(attr, QStringLiteral("height"));
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 808 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
802 o->setID(id);
803 o->setDoc(node->documentation());
804 parentPkg->addObject(o);
805
806 } else if (objType == QStringLiteral("Component") || objType == QStringLiteral("module")) {
807 UMLObject *o = Object_Factory::createUMLObject(UMLObject::ot_Component, name, parentPkg, false);
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "setID", when it could be moved instead.
808 o->setID(id);
809 o->setDoc(node->documentation());
810 parentPkg->addObject(o);
811
812 } else if (objType == QStringLiteral("Association")) {
813 PetalNode *roles = node->findAttribute(QStringLiteral("roles")).node;
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 769 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
763 }
764 // insert literals
765 LiteralsReader litReader(e);
766 litReader.read(node, e->name());
767 } else {
768 o = Object_Factory::createUMLObject(UMLObject::ot_Class, name, parentPkg, false);
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "setID", when it could be moved instead.
769 o->setID(id);
770 UMLClassifier *c = o->asUMLClassifier();
771 // set stereotype
772 if (!stereotype.isEmpty()) {
773 if (stereotype.toLower() == QStringLiteral("interface")) {
774 c->setBaseType(UMLObject::ot_Interface);
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 728 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
722 umbrellify(atts[i].second.node, localParent);
723 }
724 for (int i = 0; i < pratts.count(); ++i) {
725 umbrellify(pratts[i].second.node, localParent);
726 }
727 } else {
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "handleControlledUnit", when it could be moved instead.
728 o = handleControlledUnit(node, name, id, parentPkg);
729 if (o == nullptr) {
730 logWarn2("Import_Rose::umbrellify: %1 handleControlledUnit(%2) returns error",
731 objType, name);
732 return false;
733 }
/home/ralf/src/umbrello/umbrello/petaltree2uml.cpp: 1197 in Import_Rose::umbrellify(PetalNode *, UMLPackage *)()
1191 if (name.isEmpty()) {
1192 PetalNode *lblNode = attr->findAttribute(QStringLiteral("label")).node;
1193 if (lblNode) {
1194 name = clean(lblNode->findAttribute(QStringLiteral("label")).string);
1195 }
1196 }
>>> CID 894498: (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "ObjectNodeWidget", when it could be moved instead.
1197 w = new ObjectNodeWidget(view->umlScene(), ObjectNodeWidget::ObjectNodeType::Normal, id);
1198 const int nameWidth = (name.length() + 1) * 12.0; // to be verified
1199 if (width < nameWidth)
1200 width = nameWidth;
1201 if (height < 12.0)
1202 height = 12.0;
** CID 894497: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/statewidget.cpp: 40 in StateWidget::StateWidget(UMLScene *, StateWidget::StateType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894497: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/statewidget.cpp: 40 in StateWidget::StateWidget(UMLScene *, StateWidget::StateType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
34 *
35 * @param scene The parent of the widget.
36 * @param stateType The type of state.
37 * @param id The ID to assign (-1 will prompt a new ID.)
38 */
39 StateWidget::StateWidget(UMLScene * scene, StateType stateType, Uml::ID::Type id)
>>> CID 894497: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "UMLWidget", when it could be moved instead.
40 : UMLWidget(scene, WidgetBase::wt_State, id)
41 {
42 setStateType(stateType);
43 m_drawVertical = true;
44 // Set non zero size to avoid crash on painting.
45 // We cannot call the reimplemented method minimumSize() in the constructor
** CID 894496: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/widgetbase.cpp: 73 in WidgetBase::WidgetBase(UMLScene *, WidgetBase::WidgetType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894496: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlwidgets/widgetbase.cpp: 73 in WidgetBase::WidgetBase(UMLScene *, WidgetBase::WidgetType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
67 */
68 WidgetBase::WidgetBase(UMLScene *scene, WidgetType type, Uml::ID::Type id)
69 : QGraphicsObjectWrapper(),
70 m_baseType(type),
71 m_scene(scene),
72 m_umlObject(nullptr),
>>> CID 894496: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is copied in call to copy constructor for class "Uml::ID::Type", when it could be moved instead.
73 m_nId(id == Uml::ID::None ? UniqueID::gen() : id),
74 m_nLocalID(UniqueID::gen()),
75 m_textColor(QColor("black")),
76 m_fillColor(QColor("yellow")),
77 m_brush(m_fillColor),
78 m_lineWidth(0), // initialize with 0 to have valid start condition
** CID 894495: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/umlobject.cpp: 1011 in UMLObject::loadStereotype(QDomElement &)()
_____________________________________________________________________________________________
*** CID 894495: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/umlobject.cpp: 1011 in UMLObject::loadStereotype(QDomElement &)()
1005 if (stereo.isEmpty())
1006 return false;
1007 Uml::ID::Type stereoID = Uml::ID::fromString(stereo);
1008 UMLDoc *pDoc = UMLApp::app()->document();
1009 if (m_pStereotype)
1010 m_pStereotype->decrRefCount();
>>> CID 894495: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "stereoID" is passed-by-value as parameter to "findStereotypeById", when it could be moved instead.
1011 m_pStereotype = pDoc->findStereotypeById(stereoID);
1012 if (m_pStereotype)
1013 m_pStereotype->incrRefCount();
1014 else
1015 m_SecondaryId = stereo; // leave it to resolveRef()
1016 return true;
** CID 894494: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlscene.cpp: 4285 in UMLScene::loadUisDiagramPresentation(QDomElement &)()
_____________________________________________________________________________________________
*** CID 894494: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlscene.cpp: 4285 in UMLScene::loadUisDiagramPresentation(QDomElement &)()
4279 logDebug1("UMLScene::loadUisDiagramPresentation: ignoring tag %1", tag);
4280 }
4281 n = n.nextSibling();
4282 e = n.toElement();
4283 }
4284 Uml::ID::Type id = Uml::ID::fromString(idStr);
>>> CID 894494: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "findObjectById", when it could be moved instead.
4285 UMLObject *o = m_doc->findObjectById(id);
4286 if (o == nullptr) {
4287 logError1("loadUisDiagramPresentation: Cannot find object for id %1", idStr);
4288 } else {
4289 UMLObject::ObjectType ot = o->baseType();
4290 logDebug1("UMLScene::loadUisDiagramPresentation: Create widget for model object of type %1",
** CID 894493: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/folder.cpp: 38 in UMLFolder::UMLFolder(const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
_____________________________________________________________________________________________
*** CID 894493: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/folder.cpp: 38 in UMLFolder::UMLFolder(const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
32 * Sets up a Folder.
33 * @param name The name of the Folder.
34 * @param id The unique id of the Folder. A new ID will be generated
35 * if this argument is left away.
36 */
37 UMLFolder::UMLFolder(const QString & name, Uml::ID::Type id)
>>> CID 894493: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "UMLPackage", when it could be moved instead.
38 : UMLPackage(name, id)
39 {
40 m_BaseType = UMLObject::ot_Folder;
41 UMLObject::setStereotypeCmd(QStringLiteral("folder"));
42 }
43
** CID 894492: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/enum.cpp: 138 in UMLEnum::addEnumLiteral(const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, const QString &)()
_____________________________________________________________________________________________
*** CID 894492: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/ralf/src/umbrello/umbrello/umlmodel/enum.cpp: 138 in UMLEnum::addEnumLiteral(const QString &, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, const QString &)()
132 {
133 UMLObject *el = UMLCanvasObject::findChildObject(name);
134 if (el != nullptr) {
135 logDebug1("UMLEnum::addEnumLiteral: %1 is already present", name);
136 return el;
137 }
>>> CID 894492: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "id" is passed-by-value as parameter to "UMLEnumLiteral", when it could be moved instead.
138 UMLEnumLiteral* literal = new UMLEnumLiteral(this, name, id, value);
139 subordinates().append(literal);
140 UMLObject::emitModified();
141 Q_EMIT enumLiteralAdded(literal);
142 connect(literal, SIGNAL(modified()), this, SIGNAL(modified()));
143 return literal;
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/umbrello-uml-modeller?tab=overview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20250905/d28fe0b0/attachment-0001.htm>
More information about the umbrello-devel
mailing list