Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-17688

Dead code identified by Coverty

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P4: Low
    • None
    • Qt Creator 4.3.0-beta1
    • FakeVim
    • None

    Description

      
      
      ** CID 1399645:  Control flow issues  (DEADCODE)
      /qt-creator/src/plugins/fakevim/fakevimplugin.cpp: 1637 in FakeVim::Internal::FakeVimPluginPrivate::fold(FakeVim::Internal::FakeVimHandler *, int, bool)()
      
      
      ________________________________________________________________________________________________________
      *** CID 1399645:  Control flow issues  (DEADCODE)
      /qt-creator/src/plugins/fakevim/fakevimplugin.cpp: 1637 in FakeVim::Internal::FakeVimPluginPrivate::fold(FakeVim::Internal::FakeVimHandler *, int, bool)()
      1631                     // recursively open fold
      1632                     while (depth < 0 && block.isValid()
      1633                         && TextDocumentLayout::foldingIndent(block) >= indent) {
      1634                         if (TextDocumentLayout::canFold(block)) {
      1635                             TextDocumentLayout::doFoldOrUnfold(block, true);
      1636                             if (depth > 0)
      >>>    CID 1399645:  Control flow issues  (DEADCODE)
      >>>    Execution cannot reach this statement: "--depth;".
      1637                                 --depth;
      1638                         }
      1639                         block = block.next();
      1640                     }
      1641                 } else {
      1642                     if (TextDocumentLayout::canFold(block)) {
      
      ** CID 1399644:  Error handling issues  (CHECKED_RETURN)
      /qt-creator/src/plugins/fakevim/fakevimplugin.cpp: 1970 in FakeVim::Internal::FakeVimPluginPrivate::handleExCommand(FakeVim::Internal::FakeVimHandler *, bool *, const FakeVim::Internal::ExCommand &)()
      
      
      ________________________________________________________________________________________________________
      *** CID 1399644:  Error handling issues  (CHECKED_RETURN)
      /qt-creator/src/plugins/fakevim/fakevimplugin.cpp: 1970 in FakeVim::Internal::FakeVimPluginPrivate::handleExCommand(FakeVim::Internal::FakeVimHandler *, bool *, const FakeVim::Internal::ExCommand &)()
      1964             const QString fileName = handler->currentFileName();
      1965             if (editor && editor->document()->filePath().toString() == fileName) {
      1966                 triggerAction(Core::Constants::SAVE);
      1967                 saved = !editor->document()->isModified();
      1968                 if (saved) {
      1969                     QFile file3(fileName);
      >>>    CID 1399644:  Error handling issues  (CHECKED_RETURN)
      >>>    Calling "open" without checking return value (as is done elsewhere 129 out of 147 times).
      1970                     file3.open(QIODevice::ReadOnly);
      1971                     const QByteArray ba = file3.readAll();
      1972                     handler->showMessage(MessageInfo, Tr::tr("\"%1\" %2 %3L, %4C written")
      1973                         .arg(fileName).arg(' ').arg(ba.count('\n')).arg(ba.size()));
      1974                     if (cmd.cmd == "wq")
      1975                         delayedQuitRequested(cmd.hasBang, m_editorToHandler.key(handler));
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            hjk hjk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes