[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    New Defects reported by Coverity Scan for krita
From:       scan-admin () coverity ! com
Date:       2024-04-04 20:19:39
Message-ID: 660f0b5adc62f_27d542bc2fbf579b056864 () prd-scan-dashboard-0 ! mail
[Download RAW message or body]

Hi,

Please find the latest report on new defect(s) introduced to krita found \
with Coverity Scan.

654 new defect(s) introduced to krita found with Coverity Scan.
50 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 654 defect(s)


** CID 492078:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/kis_paintop_settings_widget.cpp: \
141 in KisPaintOpSettingsWidget::writeConfiguration(KisPinnedSharedPtr<KisPropertiesConfiguration>) \
const()


________________________________________________________________________________________________________
                
*** CID 492078:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/kis_paintop_settings_widget.cpp: \
141 in KisPaintOpSettingsWidget::writeConfiguration(KisPinnedSharedPtr<KisPropertiesConfiguration>) \
const() 135             indexcount++;
136         }
137     }
138     
139     void KisPaintOpSettingsWidget::writeConfiguration(KisPropertiesConfigurationSP \
config) const 140     {
> > > CID 492078:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "config" is passed-by-value as parameter to \
> > > "createLockedPropertiesProxy" when it could be moved instead.
141         KisLockedPropertiesProxySP propertiesProxy = \
KisLockedPropertiesServer::instance()->createLockedPropertiesProxy(config); \
142         Q_FOREACH (const KisPaintOpOption* option, m_d->paintOpOptions) \
{ 143             option->startWriteOptionSetting(propertiesProxy);
144         }
145     }
146     

** CID 492077:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/psd/psd_layer_section.cpp: 725 in \
PSDLayerMaskSection::writePsdImpl(QIODevice &, KisSharedPtr<KisNode>, \
psd_compression_type)()


________________________________________________________________________________________________________
                
*** CID 492077:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/psd/psd_layer_section.cpp: 725 in \
PSDLayerMaskSection::writePsdImpl(QIODevice &, KisSharedPtr<KisNode>, \
psd_compression_type)() 719                     layerRecord->labelColor = \
nodeLabelColor; 720     
721                     layerRecord->transparencyProtected = alphaLocked;
722                     layerRecord->visible = nodeVisible;
723                     layerRecord->irrelevant = nodeIrrelevant;
724     
> > > CID 492077:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "nodeName" is copied in call to copy constructor "QString", when it \
> > > could be moved instead.
725                     layerRecord->layerName = nodeName.isEmpty() ? \
i18n("Unnamed Layer") : nodeName; 726     
727                     layerRecord->fillType = fillType;
728                     layerRecord->fillConfig = fillConfig;
729     
730                     layerRecord->write(io, layerContentDevice, \
onlyTransparencyMask, maskRect, sectionType, stylesXmlDoc, \
node->inherits("KisGroupLayer"));

** CID 490754:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/flake/text/KoSvgTextShape_p_layout.cpp: \
255 in KoSvgTextShape::Private::relayout()()


________________________________________________________________________________________________________
                
*** CID 490754:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/flake/text/KoSvgTextShape_p_layout.cpp: \
255 in KoSvgTextShape::Private::relayout()() 249         globalIndex = 0;
250         bool wrapped = !(inlineSize.isAuto && \
this->shapesInside.isEmpty()); 251         if \
(!resolvedTransforms.isEmpty()) { 252             \
resolvedTransforms[0].xPos = 0; 253             resolvedTransforms[0].yPos \
= 0; 254         }
> > > CID 490754:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "collapseChars" is passed-by-value as parameter to \
> > > "resolveTransforms" when it could be moved instead.
255         this->resolveTransforms(textData.childBegin(), text, result, \
globalIndex, isHorizontal, wrapped, false, resolvedTransforms, \
collapseChars); 256     
257         QMap<int, KoSvgText::TabSizeInfo> tabSizeInfo;
258     
259         // pass everything to a css-compatible text-layout algortihm.
260         raqm_t_sp layout(raqm_create());

** CID 490753:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/image/tests/kis_strokes_queue_test.cpp: \
338 in KisStrokesQueueTest::testOpenedStrokeCounter()()


________________________________________________________________________________________________________
                
*** CID 490753:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/image/tests/kis_strokes_queue_test.cpp: \
338 in KisStrokesQueueTest::testOpenedStrokeCounter()() 332         \
KisStrokeId id0 = queue.startStroke(new \
KisTestingStrokeStrategy(QLatin1String("0"))); 333         \
QVERIFY(queue.hasOpenedStrokes()); 334         KisStrokeId id1 = \
queue.startStroke(new KisTestingStrokeStrategy(QLatin1String("1"))); 335    \
QVERIFY(queue.hasOpenedStrokes()); 336         queue.endStroke(id0);
337         QVERIFY(queue.hasOpenedStrokes());
> > > CID 490753:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "id1" is passed-by-value as parameter to "endStroke" when it could be \
> > > moved instead.
338         queue.endStroke(id1);
339         QVERIFY(!queue.hasOpenedStrokes());
340     
341         KisTestableUpdaterContext context(2);
342         queue.processQueue(context, false); context.clear();
343         queue.processQueue(context, false); context.clear();

** CID 490752:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/kis_canvas_resource_provider.cpp: \
363 in KisCanvasResourceProvider::slotGamutMaskActivated(QSharedPointer<KoGamutMask>)()



________________________________________________________________________________________________________
                
*** CID 490752:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/kis_canvas_resource_provider.cpp: \
363 in KisCanvasResourceProvider::slotGamutMaskActivated(QSharedPointer<KoGamutMask>)()
 357         QVariant v;
358         v.setValue<KoGamutMaskSP>(mask);
359         m_resourceManager->setResource(KoCanvasResource::CurrentGamutMask, \
v); 360     
361         m_resourceManager->setResource(KoCanvasResource::GamutMaskActive, \
QVariant::fromValue(true)); 362     
> > > CID 490752:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "mask" is passed-by-value as parameter to "sigGamutMaskChanged" when \
> > > it could be moved instead.
363         emit sigGamutMaskChanged(mask);
364     }
365     
366     void KisCanvasResourceProvider::slotGamutMaskUnset()
367     {
368         m_resourceManager->setResource(KoCanvasResource::GamutMaskActive, \
QVariant::fromValue(false));

** CID 490751:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/flake/text/KoSvgTextShapeLayoutFunc_lines.cpp: \
577 in KoSvgTextShapeLayoutFunc::breakLines(const KoSvgTextProperties &, \
const QMap<int, int> &, QVector<CharacterResult> &, QPointF)()


________________________________________________________________________________________________________
                
*** CID 490751:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/flake/text/KoSvgTextShapeLayoutFunc_lines.cpp: \
577 in KoSvgTextShapeLayoutFunc::breakLines(const KoSvgTextProperties &, \
const QMap<int, int> &, QVector<CharacterResult> &, QPointF)() 571          \
currentPos += currentLine.textIndent; 572                                 }
573                                 wordAdvance = result.at(i).advance;
574                                 partialWord.append(i);
575                             }
576                         }
> > > CID 490751:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "partialWord" is copied in a call to copy assignment "operator =", \
> > > when it could be moved instead.
577                         wordIndices = partialWord;
578                     }
579                 }
580                 addWordToLine(result, currentPos, wordIndices, \
currentLine, ltr, isHorizontal); 581             }
582     

** CID 490750:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/kis_statusbar.cc: 330 in \
KisStatusBar::updateMemoryStatus()()


________________________________________________________________________________________________________
                
*** CID 490750:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/kis_statusbar.cc: 330 in \
KisStatusBar::updateMemoryStatus()() 324                           \
"\t\tPlease configure more RAM for Krita in Settings dialog"); 325          \
longStats += suffix; 326     
327     
328         }
329     
> > > CID 490750:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "shortStats" is copied in a call to copy assignment "operator =", \
> > > when it could be moved instead.
330         m_shortMemoryTag = shortStats;
331         m_longMemoryTag = longStats;
332         m_memoryStatusIcon = icon;
333     
334         m_memoryReportBox->setMaximumMemory(stats.totalMemoryLimit);
335         m_memoryReportBox->setCurrentMemory(stats.totalMemorySize);

** CID 490749:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/image/commands/kis_node_property_list_command.cpp: \
60 in KisNodePropertyListCommand::KisNodePropertyListCommand(KisSharedPtr<KisNode>, \
QList<KisBaseNode::Property>)()


________________________________________________________________________________________________________
                
*** CID 490749:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/image/commands/kis_node_property_list_command.cpp: \
60 in KisNodePropertyListCommand::KisNodePropertyListCommand(KisSharedPtr<KisNode>, \
QList<KisBaseNode::Property>)() 54     
55     }
56     
57     
58     KisNodePropertyListCommand::KisNodePropertyListCommand(KisNodeSP \
node, KisBaseNode::PropertyList newPropertyList) 59         : \
KisNodeCommand(kundo2_i18n("Property Changes"), node),
> > > CID 490749:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "newPropertyList" is copied in call to copy constructor \
> > > "QList<KisBaseNode::Property>", when it could be moved instead.
60           m_newPropertyList(newPropertyList),
61           m_oldPropertyList(node->sectionModelProperties())
62         /**
63          * TODO instead of "Property Changes" check which property
64          * has been changed and display either lock/unlock, \
visible/hidden 65          * or "Property Changes" (this require new \
strings)

** CID 490748:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/KisImportExportUtils.h: 47 in \
KritaUtils::ExportFileJob::ExportFileJob(QString, QByteArray, \
QFlags<KritaUtils::SaveFlag>)()


________________________________________________________________________________________________________
                
*** CID 490748:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/KisImportExportUtils.h: 47 in \
KritaUtils::ExportFileJob::ExportFileJob(QString, QByteArray, \
QFlags<KritaUtils::SaveFlag>)() 41         ExportFileJob()
42             : flags(SaveNone)
43         {
44         }
45     
46         ExportFileJob(QString _filePath, QByteArray _mimeType, SaveFlags \
_flags = SaveNone)
> > > CID 490748:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "_mimeType" is copied in call to copy constructor "QByteArray", when \
> > > it could be moved instead.
47             : filePath(_filePath), mimeType(_mimeType), flags(_flags)
48         {
49         }
50     
51         bool isValid() const {
52             return !filePath.isEmpty();

** CID 490747:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/image/tests/kis_strokes_queue_test.cpp: \
359 in KisStrokesQueueTest::testAsyncCancelWhileOpenedStroke()()


________________________________________________________________________________________________________
                
*** CID 490747:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/image/tests/kis_strokes_queue_test.cpp: \
359 in KisStrokesQueueTest::testAsyncCancelWhileOpenedStroke()() 353        \
queue.addJob(id, 0); 354         queue.addJob(id, 0);
355     
356         // no async cancelling until the stroke is ended by the owner
357         QVERIFY(!queue.tryCancelCurrentStrokeAsync());
358     
> > > CID 490747:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "id" is passed-by-value as parameter to "endStroke" when it could be \
> > > moved instead.
359         queue.endStroke(id);
360     
361         QVERIFY(queue.tryCancelCurrentStrokeAsync());
362     
363         bool externalJobsPending = false;
364     

** CID 490746:  Performance inefficiencies  (PASS_BY_VALUE)
/home/appimage/appimage-workspace/deps/usr/include/lager/detail/nodes.hpp: \
303 in _ZN5lager6detail9root_nodeI23MyPaintChangeColorHDataNS0_11cursor_nodeEECI1NS0_11reader_nodeIS2_EEES2_()



________________________________________________________________________________________________________
                
*** CID 490746:  Performance inefficiencies  (PASS_BY_VALUE)
/home/appimage/appimage-workspace/deps/usr/include/lager/detail/nodes.hpp: \
303 in _ZN5lager6detail9root_nodeI23MyPaintChangeColorHDataNS0_11cursor_nodeEECI1NS0_11reader_nodeIS2_EEES2_()
 297     };
298     
299     template <typename T, template <class> class Base = reader_node>
300     struct root_node : Base<T>
301     {
302         using base_t = Base<T>;
> > > CID 490746:  Performance inefficiencies  (PASS_BY_VALUE)
> > > Passing parameter 1 of type \
> > > "std::remove_reference_t<MyPaintChangeColorHData>" (size 144 bytes) \
> > > by value, which exceeds the low threshold of 128 bytes.
303         using base_t::base_t;
304     
305         void refresh() final override {}
306     };
307     
308     template <typename... Nodes>

** CID 490745:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/KisFrameCacheStore.cpp: 97 in \
<unnamed>::FrameInfo::FrameInfo(const QRect &, const QRect &, int, \
KisFrameDataSerializer &, QSharedPointer<<unnamed>::FrameInfo>)()


________________________________________________________________________________________________________
                
*** CID 490745:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/ui/KisFrameCacheStore.cpp: 97 in \
<unnamed>::FrameInfo::FrameInfo(const QRect &, const QRect &, int, \
KisFrameDataSerializer &, QSharedPointer<<unnamed>::FrameInfo>)() 91     
92     // copy frame
93     FrameInfo::FrameInfo(const QRect &dirtyImageRect, const QRect \
&imageBounds, int levelOfDetail, KisFrameDataSerializer &serializer, \
FrameInfoSP baseFrame) 94         : m_levelOfDetail(levelOfDetail),
95           m_dirtyImageRect(dirtyImageRect),
96           m_imageBounds(imageBounds),
> > > CID 490745:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "baseFrame" is copied in call to copy constructor \
> > > "QSharedPointer<<unnamed>::FrameInfo>", when it could be moved \
> > > instead.
97           m_baseFrame(baseFrame),
98           m_type(FrameCopy),
99           m_savedFrameDataId(-1),
100           m_serializer(serializer)
101     {
102     }

** CID 490744:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/assistants/Assistants/kis_assistant_tool.cc: \
922 in KisAssistantTool::assistantSelected(QSharedPointer<KisPaintingAssistant>)()



________________________________________________________________________________________________________
                
*** CID 490744:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/assistants/Assistants/kis_assistant_tool.cc: \
922 in KisAssistantTool::assistantSelected(QSharedPointer<KisPaintingAssistant>)()
 916         m_canvas->paintingAssistantsDecoration()->deselectAssistant();
917         updateToolOptionsUI();
918     }
919     
920     void KisAssistantTool::assistantSelected(KisPaintingAssistantSP \
assistant) 921     {
> > > CID 490744:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "assistant" is passed-by-value as parameter to "setSelectedAssistant" \
> > > when it could be moved instead.
922          m_canvas->paintingAssistantsDecoration()->setSelectedAssistant(assistant);
 923          updateToolOptionsUI();
924     }
925     
926     void KisAssistantTool::updateToolOptionsUI()
927     {

** CID 490743:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/paintops/libpaintop/kis_brush_option.cpp: \
118 in KisBrushOptionProperties::setBrush(QSharedPointer<KisBrush>)()


________________________________________________________________________________________________________
                
*** CID 490743:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/paintops/libpaintop/kis_brush_option.cpp: \
118 in KisBrushOptionProperties::setBrush(QSharedPointer<KisBrush>)() 112   \
{ 113         return m_brush;
114     }
115     
116     void KisBrushOptionProperties::setBrush(KisBrushSP brush)
117     {
> > > CID 490743:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "brush" is copied in a call to copy assignment "operator =", when it \
> > > could be moved instead.
118         m_brush = brush;

** CID 490742:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/global/KisSynchronizedConnection.cpp: \
68 in KisSynchronizedConnectionBase::registerSynchronizedEventBarrier(std::function<void \
()>)()


________________________________________________________________________________________________________
                
*** CID 490742:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/global/KisSynchronizedConnection.cpp: \
68 in KisSynchronizedConnectionBase::registerSynchronizedEventBarrier(std::function<void \
()>)() 62         return s_instance->eventType;
63     }
64     
65     void KisSynchronizedConnectionBase::registerSynchronizedEventBarrier(std::function<void \
()> callback) 66     {
67         KIS_SAFE_ASSERT_RECOVER_NOOP(!s_barrier->callback);
> > > CID 490742:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "callback" is copied in a call to copy assignment "operator =", when \
> > > it could be moved instead.
68         s_barrier->callback = callback;
69     }
70     
71     void KisSynchronizedConnectionBase::setAutoModeForUnittestsEnabled(bool \
value) 72     {
73         s_instance->enableAutoModeForUnittests = value;

** CID 490741:  Performance inefficiencies  (PASS_BY_VALUE)
/home/appimage/appimage-workspace/deps/usr/include/lager/detail/nodes.hpp: \
303 in _ZN5lager6detail9root_nodeI16KisHueOptionDataNS0_11cursor_nodeEECI1NS0_11reader_nodeIS2_EEES2_()



________________________________________________________________________________________________________
                
*** CID 490741:  Performance inefficiencies  (PASS_BY_VALUE)
/home/appimage/appimage-workspace/deps/usr/include/lager/detail/nodes.hpp: \
303 in _ZN5lager6detail9root_nodeI16KisHueOptionDataNS0_11cursor_nodeEECI1NS0_11reader_nodeIS2_EEES2_()
 297     };
298     
299     template <typename T, template <class> class Base = reader_node>
300     struct root_node : Base<T>
301     {
302         using base_t = Base<T>;
> > > CID 490741:  Performance inefficiencies  (PASS_BY_VALUE)
> > > Passing parameter 1 of type \
> > > "std::remove_reference_t<KisHueOptionData>" (size 144 bytes) by \
> > > value, which exceeds the low threshold of 128 bytes.
303         using base_t::base_t;
304     
305         void refresh() final override {}
306     };
307     
308     template <typename... Nodes>

** CID 490740:    (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/resources/KisRequiredResourcesOperators.h: \
91 in KisRequiredResourcesOperators::cloneWithResourcesSnapshot<KisPinnedSharedPtr<KisFilterConfiguration>, \
KisFilterConfiguration>(const T2 *, \
                QSharedPointer<KisResourcesInterface>)()
/home/appimage/persistent/krita/libs/resources/KisRequiredResourcesOperators.h: \
91 in KisRequiredResourcesOperators::cloneWithResourcesSnapshot<QSharedPointer<KisPSDLayerStyle>, \
                KisPSDLayerStyle>(const T2 *, \
                QSharedPointer<KisResourcesInterface>)()
/home/appimage/persistent/krita/libs/resources/KisRequiredResourcesOperators.h: \
91 in KisRequiredResourcesOperators::cloneWithResourcesSnapshot<QSharedPointer<KisPaintOpPreset>, \
KisPaintOpPreset>(const T2 *, QSharedPointer<KisResourcesInterface>)()


________________________________________________________________________________________________________
                
*** CID 490740:    (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/libs/resources/KisRequiredResourcesOperators.h: \
91 in KisRequiredResourcesOperators::cloneWithResourcesSnapshot<KisPinnedSharedPtr<KisFilterConfiguration>, \
KisFilterConfiguration>(const T2 *, \
QSharedPointer<KisResourcesInterface>)() 85                                 \
KisResourcesInterfaceSP globalResourcesInterface = nullptr) 86     {
87         auto clonedStorage = object->clone();
88         TypeSP cloned = KisSharedPointerTraits<TypeSP>::template \
dynamicCastSP<T>(clonedStorage); 89     
90         if (!hasLocalResourcesSnapshot(cloned.data())) {
> > > CID 490740:    (COPY_INSTEAD_OF_MOVE)
> > > "globalResourcesInterface" is passed-by-value as parameter to \
> > > "createLocalResourcesSnapshot" when it could be moved instead.
91             createLocalResourcesSnapshot(cloned.data(), \
globalResourcesInterface); 92             \
KIS_SAFE_ASSERT_RECOVER_NOOP(hasLocalResourcesSnapshot(cloned.data())); 93  \
} 94     
95         return cloned;
96     }
97     
98     }
99     
/home/appimage/persistent/krita/libs/resources/KisRequiredResourcesOperators.h: \
91 in KisRequiredResourcesOperators::cloneWithResourcesSnapshot<QSharedPointer<KisPSDLayerStyle>, \
KisPSDLayerStyle>(const T2 *, QSharedPointer<KisResourcesInterface>)() 85   \
KisResourcesInterfaceSP globalResourcesInterface = nullptr) 86     {
87         auto clonedStorage = object->clone();
88         TypeSP cloned = KisSharedPointerTraits<TypeSP>::template \
dynamicCastSP<T>(clonedStorage); 89     
90         if (!hasLocalResourcesSnapshot(cloned.data())) {
> > > CID 490740:    (COPY_INSTEAD_OF_MOVE)
> > > "globalResourcesInterface" is passed-by-value as parameter to \
> > > "createLocalResourcesSnapshot" when it could be moved instead.
91             createLocalResourcesSnapshot(cloned.data(), \
globalResourcesInterface); 92             \
KIS_SAFE_ASSERT_RECOVER_NOOP(hasLocalResourcesSnapshot(cloned.data())); 93  \
} 94     
95         return cloned;
96     }
97     
98     }
99     
/home/appimage/persistent/krita/libs/resources/KisRequiredResourcesOperators.h: \
91 in KisRequiredResourcesOperators::cloneWithResourcesSnapshot<QSharedPointer<KisPaintOpPreset>, \
KisPaintOpPreset>(const T2 *, QSharedPointer<KisResourcesInterface>)() 85   \
KisResourcesInterfaceSP globalResourcesInterface = nullptr) 86     {
87         auto clonedStorage = object->clone();
88         TypeSP cloned = KisSharedPointerTraits<TypeSP>::template \
dynamicCastSP<T>(clonedStorage); 89     
90         if (!hasLocalResourcesSnapshot(cloned.data())) {
> > > CID 490740:    (COPY_INSTEAD_OF_MOVE)
> > > "globalResourcesInterface" is passed-by-value as parameter to \
> > > "createLocalResourcesSnapshot" when it could be moved instead.
91             createLocalResourcesSnapshot(cloned.data(), \
globalResourcesInterface); 92             \
KIS_SAFE_ASSERT_RECOVER_NOOP(hasLocalResourcesSnapshot(cloned.data())); 93  \
} 94     
95         return cloned;
96     }
97     
98     }
99     

** CID 490739:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/impex/libkra/kis_kra_loader.cpp: \
1130 in KisKraLoader::loadFileLayer(const QDomElement &, \
KisSharedPtr<KisImage>, const QString &, unsigned int, const KoColorSpace \
*)()


________________________________________________________________________________________________________
                
*** CID 490739:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/impex/libkra/kis_kra_loader.cpp: \
1130 in KisKraLoader::loadFileLayer(const QDomElement &, \
KisSharedPtr<KisImage>, const QString &, unsigned int, const KoColorSpace \
*)() 1124                 KoFileDialog dialog(0, KoFileDialog::OpenFile, \
"OpenDocument"); 1125                 \
dialog.setMimeTypeFilters(KisImportExportManager::supportedMimeTypes(KisImportExportManager::Import));
 1126                 dialog.setDefaultDir(basePath);
1127                 QString url = dialog.filename();
1128     
1129                 if (!QFileInfo(basePath).exists()) {
> > > CID 490739:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "url" is copied in a call to copy assignment "operator =", when it \
> > > could be moved instead.
1130                     filename = url;
1131                 } else {
1132                     QDir d(basePath);
1133                     filename = d.relativeFilePath(url);
1134                 }
1135             }

** CID 490738:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/tools/defaulttool/referenceimagestool/ToolReferenceImages.cpp: \
185 in ToolReferenceImages::loadReferenceImages()()


________________________________________________________________________________________________________
                
*** CID 490738:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/tools/defaulttool/referenceimagestool/ToolReferenceImages.cpp: \
185 in ToolReferenceImages::loadReferenceImages()() 179             \
Q_FOREACH(auto *reference, collection.referenceImages()) { 180              \
reference->setZIndex(currentZIndex); 181                 \
shapes.append(reference); 182                 currentZIndex += 1;
183             }
184     
> > > CID 490738:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "shapes" is passed-by-value as parameter to "addReferenceImages" when \
> > > it could be moved instead.
185             canvas()->addCommand(KisReferenceImagesLayer::addReferenceImages(document(), \
shapes)); 186         } else {
187             QMessageBox::critical(qApp->activeWindow(), \
i18nc("@title:window", "Krita"), i18n("Could not load reference images from \
'%1'.", filename)); 188         }
189         file.close();
190     }

** CID 490737:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/impex/qimageio/kis_qimageio_export.cpp: \
89 in KisQImageIOExport::initializeCapabilities()()


________________________________________________________________________________________________________
                
*** CID 490737:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/appimage/persistent/krita/plugins/impex/qimageio/kis_qimageio_export.cpp: \
89 in KisQImageIOExport::initializeCapabilities()() 83     
84     void KisQImageIOExport::initializeCapabilities()
85     {
86         QList<QPair<KoID, KoID> > supportedColorModels;
87         supportedColorModels << QPair<KoID, KoID>()
88                 << QPair<KoID, KoID>(RGBAColorModelID, \
Integer8BitsColorDepthID);
> > > CID 490737:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
> > > "supportedColorModels" is passed-by-value as parameter to \
> > > "addSupportedColorModels" when it could be moved instead.
89         addSupportedColorModels(supportedColorModels, \
KisMimeDatabase::descriptionForMimeType(mimeType())); 90         \
addCapability(KisExportCheckRegistry::instance()->get("ColorModelPerLayerCheck/" \
+ RGBAColorModelID.id() + "/" + \
Integer8BitsColorDepthID.id())->create(KisExportCheckBase::SUPPORTED)); 91  \
} 92     
93     KisConfigWidget \
*KisQImageIOExport::createConfigurationWidget(QWidget *parent, const \
QByteArray& /*from*/, const QByteArray& /*to*/) const 94     {


________________________________________________________________________________________________________
 To view the defects in Coverity Scan visit, \
https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2B \
KADyCpvUKOL6EWmZljiu5gzcy6ShDi8gOI97yt4PxN0WdTPCCwy5jWTy9rkTKogA-3D-3DTyHf_Y \
4i2iIXYnDo-2FJnf5R5M-2Ff5mw6kl6qHmmlqiQwkdgEiE0-2FCVkQTZ93vmFXdTNKyqV3j-2FLe \
h35Labzi-2B5RAIVFVnqPPc2OR-2BNv8VmCgtmOOV9d3TVBKXD8fL588EBKrsBU4VsCWRdnJsvaq \
BxH-2Bwb86n0-2BSbmvFf34ryCr1mfiQXcnD90-2BxJesHx-2FWJSSqZYty6VZWa7kfnrSp724wgS46ZA-3D-3D



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic