Advisory clang-tidy: new findings not in .clang-tidy-baseline.txt

Aperta
#681 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
tooling

Direzione di ricerca

Start with the nightly advisory run linked in the issue and compare its 192 findings with .clang-tidy-baseline.txt (882 rows). The report lists affected signatures across many src/*.h files, including src/backhops.h and src/filter.h; inspect each finding to decide whether it is a defect or an accepted warning. Done means fixing real defects and adding accepted findings to the baseline.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

clang-tidy-advisory

The nightly ADVISORY clang-tidy report (clang-tidy 22, the .clang-tidy catalogue) has 105 finding(s) that are not in .clang-tidy-baseline.txt (baseline 967 rows) at 785143c89f5bf72acd4346cd38759e1125958ebf.
Run: https://github.com/redhat-et/ripwire/actions/runs/45119507030

The advisory step never gates. Each row below is either a real defect to fix or a false positive / accepted finding to add to the baseline. Keys are file + check + the trimmed source line, so line numbers here are for finding the spot only.

NEW rows by check
bugprone-easily-swappable-parameters (74)
  • src/darkflags.h:1955 - inline bool shellSeparator( char c, std::size_t col, std::uint32_t lineNo, ShellScan& st, FileHarvest& fh, She
  • src/darkflags.h:1627 - inline void shellArithWord( std::string_view line, std::size_t at, std::uint32_t lineNo, ShellScan::Frame& f )
  • src/darkflags.h:1879 - inline void shellCommitPending( ShellScan& st, ShellScan::Frame& f, FileHarvest& fh, std::uint32_t lineNo, std
  • src/darkflags.h:1234 - inline void shellLiteralReads( std::string_view text, std::size_t from, std::uint32_t lineNo, FileHarvest& fh,
  • src/darkflags.h:1694 - inline void shellNarrowFrom( ShellScan& st, FileHarvest& fh, std::size_t from, std::uint32_t line, std::size_t
  • src/declinedsites.h:514 - inline DeclinedSiteCut declinedSiteCut( std::size_t total, int pageLimit, std::string_view verbFlag, std::stri
  • src/defectshape.h:2997 - Prov provFile( const std::string& target, std::uint32_t pos, std::uint32_t scope, const Env& env, int depth )
  • src/defectshape.h:2646 - Prov provVar( std::string_view name, std::uint32_t pos, std::uint32_t scope, const Env& env, int depth ) const
  • src/defectshape.h:2864 - Prov throughCall( std::uint32_t call, std::uint32_t f, Prov p ) const
  • src/defectshape.h:3831 - bool isLastOfFunc( std::uint32_t c, std::uint32_t f ) const
  • src/defectshape.h:3646 - bool rcTested( const std::string& name, std::uint32_t scope, std::uint32_t after, std::uint32_t until, int dep
  • src/defectshape.h:5058 - inline bool commentStatesOmission( std::string_view src, std::size_t b, std::size_t e, const std::vector<std::
  • src/defectshape.h:4235 - inline bool fopenedForWrite( std::string_view src, const std::vector<Tok>& toks, std::size_t from, std::size_t
  • src/defectshape.h:4509 - inline bool pyNameStatusUnread( std::string_view src, const std::vector<Tok>& toks, std::size_t from, std::siz
  • src/defectshape.h:5696 - inline bool readIn( std::string_view src, std::string_view name, std::size_t b, std::size_t e )
  • src/defectshape.h:4209 - inline bool writtenThrough( std::string_view src, const std::vector<Tok>& toks, std::size_t from, std::size_t
  • src/defectshape.h:4255 - inline std::size_t enclosingBlockOpen( std::string_view src, const std::vector<Tok>& toks, std::size_t from, s
  • src/defectshape.h:5151 - inline std::size_t pyHeaderColon( std::string_view src, const std::vector<Tok>& toks, std::size_t k, std::size
  • src/defectshape.h:5446 - inline std::size_t pyValuedBodyOf( std::string_view src, const std::vector<Tok>& toks, std::size_t from, std::
  • src/defectshape.h:5281 - inline std::vector<ArgRange> pySplitAt( std::string_view src, const std::vector<Tok>& toks, std::size_t a, std
  • src/defectshape.h:5167 - inline std::vector<std::size_t> pyStatementsAt( std::string_view src, const std::vector<Tok>& toks, std::size_
  • src/defectshape.h:5100 - inline void scanUnhandledArmCpp( std::string_view src, const std::vector<Tok>& toks, const CppPreproc& pp, std
  • src/defectshape.h:4315 - std::size_t head, std::size_t close, std::size_t to )
  • src/defectshape.h:2097 - void visit( std::uint32_t list, std::uint32_t scope, std::vector<Judgment::Reach> reach )
  • src/defectshape.h:2277 - void visitSub( std::uint32_t list, std::uint32_t scope, std::uint32_t host )
  • src/foranswerfirst.h:174 - [[nodiscard]] inline bool resolvedRouted( std::string_view block, std::string_view name ) noexcept
  • src/foranswerfirst.h:131 - [[nodiscard]] inline std::vector<Block> topLevelBlocks( std::string_view doc, std::size_t bodyBegin, std::size
  • src/formanifest.h:216 - forEachJsonKey( text, [&]( int depth, std::string_view top, std::string_view key, std::string_view val, std::u
  • src/formanifest.h:750 - inline bool probedManifestReadable( const std::string& disk, const std::string& rootPrefix, std::optional<std:
  • src/formanifest.h:348 - inline void addTomlEntry( const TomlTable& table, std::string_view keyText, std::string_view value, std::uint3
  • src/graph.h:16170 - inline std::vector<NodeId> bareLaneColonTiers( const IngestResult& ing, std::string_view name, std::string_vie
  • src/graph.h:3045 - inline void addPythonMultiFileImportNames( const IngestResult& ing, const HashMap<std::string, char>& multi, H
  • src/graph.h:1372 - inline void noteProvenSite( std::vector<ProvenSite>& out, bool proven, std::size_t namesakes, std::uint32_t re
  • src/graph.h:1843 - void noteCollapsed( const IngestResult& ing, const std::string& name, std::span<const NodeId> before, std::spa
  • src/handoffwindow.h:112 - inline std::string_view printedAttrOf( std::string_view row, std::string_view name )
  • src/infra/tspredicates.h:232 - inline std::vector<std::string_view> predicateStrings( const TSQuery* q, std::string_view op, std::string_view
  • src/ingest_binds.h:7039 - inline RustBinderLook rustAncestorBinds( TSNode up, TSNode cur, std::string_view name, std::string_view src, i
  • src/ingest_binds.h:6599 - inline TSNode rustReceiverCall( TSNode call, std::uint8_t& tries, bool& awaited )
  • src/ingest_binds.h:6895 - inline bool rustStdSpineInto( TSNode type, TSNode owner, std::string_view src, std::string& spine )
  • src/ingest_elixir.h:182 - bool elixirKeepCapture( TSNode role, TSNode name, ElixirCaptureRole capture, std::string_view src, const Elixi
  • src/ingest_names.h:1013 - inline std::string rustBracketedQualifier( TSNode bracketed, TSNode at, std::string_view src )
  • src/ingest_names.h:981 - inline std::string rustBracketedTypeName( TSNode type, TSNode at, std::string_view src )
  • src/ingest_prewarm.h:302 - inline LangRowSet constructRowsNeeded( const CacheRecords& cache, const IngestFileScan& scan, const std::vecto
  • src/ingest_prewarm.h:390 - inline void captureHashAndStat( IngestFileScan& scan, std::size_t fi, std::uint64_t hash, long long sizeBytes,
  • src/ingest_rustmacroargs.h:337 - inline void rereadMacroArgBlocks( MacroArgPass& pass, std::span<const TSNode> children, std::size_t first, std
  • src/lsp.h:80 - inline std::string lspDeclaredLang( std::string_view path, std::string_view echoed )
  • src/lsp.h:1021 - inline std::string lspHandleWorkspaceSymbol( const rw::McpIndex& mix, const std::string& cwd, const std::strin
  • src/lsp.h:989, src/lsp.h:989 - inline void lspRecordDidOpen( const std::string& root, const std::string& cwd, const std::string& method, cons
  • src/memceiling.h:229 - [[noreturn]] inline void refuse( std::uint64_t footprint, std::size_t request ) noexcept
  • src/model.h:1294 - inline TangleInputs tangleInputsFrom( std::uint32_t loc, std::uint32_t maxNest, std::uint32_t deepLoc, std::ui
  • src/model.h:1282 - inline std::uint8_t tangleDispatchShare( std::uint32_t deepLoc, std::uint32_t deepDispatch, std::uint32_t nest
  • src/pyscopepin.h:101 - std::uint32_t rowHolding( std::uint32_t f, std::uint32_t byte ) const noexcept
  • src/qdbestsince.h:296 - (void)crossref::catFileBatch( root, shas, [ & ]( const std::string&, std::string_view type, std::string_view b
  • src/qdbestsince.h:210 - const bool read = crossref::catFileBatch( root, shas, [ & ]( const std::string&, std::string_view type, std::s
  • src/receiverevidence.h:915 - NodeId inGoImportedPackage( std::uint32_t fileId, std::string_view whole, std::string_view cls, Find&& find )
  • src/receiverevidence.h:1475 - RustItem rustItemOfPath( RustSite site, std::string_view modPath, std::string_view item, RustItemWalk& walk )
  • src/receiverevidence.h:4242 - std::optional<ChainValue> declaredResult( NodeId callee, NodeId owner ) const
  • src/receiverevidence.h:4361 - std::optional<ChainValue> rustChainReceiver( const Reference& r, std::uint32_t at, std::string_view name, std:
  • src/receiverevidence.h:4185 - void buildAwaitOutputs( std::span<const Binding* const> impls, std::span<const Binding* const> outputs ) const
  • src/regexguard.h:1247 - inline std::size_t regexAdjacencyGroupClose( const std::string& pat, std::size_t openAt, std::size_t scopeEnd
  • src/regexguard.h:1218 - inline std::size_t regexSkipUnparsedClass( const std::string& pat, std::size_t openAt, std::size_t scopeEnd )
  • src/resolve.h:9015 - bool bareCallReachesFree( std::int8_t& declared, const Reference& ref, std::string_view cls, std::string_view
  • src/resolve.h:8993 - bool guardedConeDeclares( std::string_view cls, std::string_view callee, const HashMap<std::string, std::vecto
  • src/resolve.h:8954 - bool guardedConeOwns( std::string_view cls, std::string_view owner, NodeId def, const HashMap<std::string, std
  • src/resolve.h:8018 - inline bool NamesakeWalk::derives( std::string_view outerName, std::string_view base, const ChaUpNames& chaUp
  • src/resolve.h:9705 - inline void indexCanonicalScopeText( HashMap<std::string, rw::SmallVec<NodeId, 2>>& byScope, HashMap<std::stri
  • src/resolve.h:8586 - std::optional<std::uint8_t> baseEdgeBound( NodeId base, NodeId derived ) const
  • src/resolve.h:8846 - void expandGuardedLevel( std::size_t lvlBegin, std::size_t lvlEnd, const HashMap<std::string, std::vector<std:
  • src/shstatus.h:706 - Lexer( std::string_view src, std::uint32_t line0, std::uint32_t base ) : src_( src ), n_( src.size() ), line_(
  • src/shstatus.h:351 - const auto classAt = [ & ]( std::size_t at, char c, std::size_t& next ) -> int // -1 no class here, 0 no match
  • src/shstatus.h:2878 - inline void namesInTest( std::string_view text, std::string_view cw, const RcFuncs& rcfuncs, std::vector<std::
  • src/shstatus.h:1256 - std::uint32_t funcNode( std::string name, std::uint32_t ln, std::uint32_t pos, std::uint32_t body )
  • src/shstatus.h:1402 - std::uint32_t parseCase( std::uint32_t ln, std::uint32_t pos )
  • src/shstatus.h:1360 - std::uint32_t parseIfLoop( const std::string& t, std::uint32_t ln, std::uint32_t pos )
performance-inefficient-vector-operation (5)
  • src/defectshape.h:5513 - for( const PyConst& c : consts )
  • src/defectshape.h:4978 - for( const auto& [ first, end ] : arms.ranges )
  • src/formanifest.h:1237 - for( const std::string_view f : features )
  • src/quality.h:11557 - for( const auto& [ key, nowOfKey ] : ratchetable )
  • src/shstatus.h:2138 - for( const Word& w : n.words )
bugprone-unchecked-optional-access (3)
  • src/graph.h:10636 - const std::string_view head = *head_;
  • src/shstatus.h:3241 - const detail::Walker& w2 = *last;
  • src/verbs_for.h:5784 - std::string doc = r.out->bytes;
performance-unnecessary-value-param (3)
  • src/defectshape.h:2097 - void visit( std::uint32_t list, std::uint32_t scope, std::vector<Judgment::Reach> reach )
  • src/testmap.h:1756 - inline std::string groupRunTail( RowDialect dialect, std::string_view head, EscapeFn esc )
  • src/verbs_lint.h:1006 - std::vector<LintOut> dedupeLintFindings( const EnclosingSymbolIndex& enclosing, std::vector<LintOut> outs )
bugprone-incorrect-roundings (2)
  • src/model.h:1332 - return std::uint32_t( tangleT( in ) * 10.0 + 0.5 );
  • src/model.h:1340 - return std::uint32_t( tangleT( in ) * std::log2( double( in.loc ) / double( kTangleAmpLoc ) ) * 10.0 + 0.5 );
bugprone-narrowing-conversions (2)
  • src/defattrib.h:799 - silent[k] = groups.untied[k] && !named[k];
  • src/receiverevidence.h:366 - cppScopeNames[ b.var ] |= bit;
clang-analyzer-deadcode.DeadStores (2)
  • src/graph.h:12492, src/graph.h:12747, src/graph.h:12974, src/graph.h:13164 - disposition = CallDisposition::Declined;
  • src/graph.h:12549, src/graph.h:12741, src/graph.h:12787, src/graph.h:12872 - disposition = vetoExternal( r );
bugprone-exception-escape (1)
  • src/foranswerfirst.h:73 - void disclose( DisclosureWhy why ) noexcept
bugprone-implicit-widening-of-multiplication-result (1)
  • src/memceiling.h:90 - inline constexpr std::size_t kLargeBytes = 256 * 1024; // largealloc's kMinBytes: these read on every call
bugprone-inc-dec-in-conditions (1)
  • src/defectshape.h:3975 - for( std::uint32_t d = 0; d < a_.facts.size(); ++d )
bugprone-signed-char-misuse (1)
  • src/formanifest.h:592 - { return lexLowerByte( static_cast<unsigned char>( a ) ) == b; } );
bugprone-suspicious-missing-comma (1)
  • src/legenddict.h:83 - "<about legend=\"ref\" dict= dictv=>: this LAST child is only the legend pointer; the root keeps every attribu
bugprone-suspicious-stringview-data-usage (1)
  • src/memstats.h:52 - memceiling::notePhase( phase.data() ); // every caller passes a string literal, so data() is NUL-terminated an
bugprone-throwing-static-initialization (1)
  • src/lsp.h:75 - rw::lspmap::LangMap gLangMap;
clang-analyzer-optin.performance.Padding (1)
  • src/cloneidiom.h:1207 - struct MemberShape
performance-for-range-copy (1)
  • src/ingest_jsimports.h:793 - for( std::string name : jsPatternNames( d.binding, src ) )
performance-move-const-arg (1)
  • src/ingest_binds.h:2981 - pushTypedBind( fileId, lang, paramDeclaratorVarName( declarator, src ), std::move( written ), BindSite{ ts_nod
performance-no-automatic-move (1)
  • src/resolve.h:8740 - return byName; // no edge either way (an alias, a base outside the tree): the name, as before
Baseline rows no longer reported (41): delete them from .clang-tidy-baseline.txt
  • src/crossref.h bugprone-easily-swappable-parameters inline WorktreeCopy readWorktreeCopy( const std::string& root, const std::string& relPath, std::stri
  • src/darkflags.h bugprone-easily-swappable-parameters inline std::size_t gateReadWindow( const Gate& g, std::size_t maxSites, int pageOffset, PageWindow&
  • src/declinedsites.h bugprone-easily-swappable-parameters inline DeclinedSiteCut declinedSiteCut( std::size_t total, int pageLimit, std::string_view verbFlag,
  • src/defectshape.h bugprone-branch-clone {
  • src/defectshape.h bugprone-easily-swappable-parameters inline bool isRunUnderTest( const std::vector<ShTok>& t, std::size_t b, std::size_t e )
  • src/defectshape.h performance-faster-string-find else if( w.rfind( "<<<", 0 ) == 0 || w.rfind( "2>", 0 ) == 0 || w.rfind( ">", 0 ) == 0 )
  • src/editcheck.h bugprone-easily-swappable-parameters inline std::vector<CallSiteAt> callSitesAt( const IngestResult& ing, std::span<const NodeId> defs, s
  • src/flipimpact.h bugprone-easily-swappable-parameters inline PageWindow flipRowWindow( std::size_t total, std::size_t maxRows, int pageOffset ) noexcept
  • src/fordemoteall.h bugprone-easily-swappable-parameters inline std::string demoteAndPointBlock( const IngestResult& ing, const Graph& g, std::string_view ta
  • src/fordocbody.h bugprone-easily-swappable-parameters inline ForDocPassage loadedUnitPassage( const IngestResult& ing, const ForDocPrep& prep, const ForDo
  • src/forfilesyms.h bugprone-easily-swappable-parameters inline std::vector<Cand> collectCands( const IngestResult& ing, const ShownFiles& sf, std::string_vi
  • src/forgraphverb.h bugprone-easily-swappable-parameters inline std::string_view attrOf( std::string_view row, std::string_view name )
  • src/forliteral.h bugprone-easily-swappable-parameters inline std::string excerptElement( const std::string& text, const std::string& path, const Symbol& s
  • src/forliteral.h bugprone-easily-swappable-parameters inline std::vector<std::uint32_t> readerFilesOf( const IngestResult& ing, const Graph* g, NodeId own
  • src/foronesidereach.h bugprone-easily-swappable-parameters inline OneSideReachEdit demoteOneSideRows( const IngestResult& ing, const Graph& g, std::string_view
  • src/foronesidereach.h bugprone-easily-swappable-parameters inline std::vector<NodeId> everyShortestRootSinkNode( const Graph& g, std::span<const NodeId> root,
  • src/forpage.h bugprone-easily-swappable-parameters const std::vector<NodeId>& headIds, std::string_view rootArg, std::string_view task )
  • src/forpage.h bugprone-easily-swappable-parameters inline TailOldWalk tailOldWalkAt( bool codeFirst, std::size_t r, std::size_t codeSeen, std::size_t w
  • src/forreexport.h bugprone-easily-swappable-parameters [[nodiscard]] std::vector<std::string> modsAt( std::uint32_t f, std::uint32_t byte ) const
  • src/ingest_cache.h bugprone-easily-swappable-parameters inline std::string reAbsolutize( std::string_view rel, std::string_view root )
  • src/ingest_elixir.h bugprone-easily-swappable-parameters bool elixirKeepCapture( TSNode role, TSNode name, bool isDef, SymKind kind, std::string_view src ) n
  • src/ingest_names.h bugprone-easily-swappable-parameters inline RawRef cratePathMacroRef( std::string_view src, std::uint32_t at, std::uint32_t nameAt, std::
  • src/ingest_prewarm.h bugprone-easily-swappable-parameters const std::vector<char>& isMiss, const std::vector<char>& isObjCHeaderMiss )
  • src/ingest_valuerefs.h performance-move-const-arg r.memberCtor = slotCtor( std::move( key ), kw );
  • src/legenddict.h bugprone-suspicious-missing-comma "<about legend=\"ref\" dict= dictv=>: the answer's rows come first; its root keeps only task= change
  • src/lsp.h bugprone-branch-clone {
  • src/memguard.h bugprone-easily-swappable-parameters inline TargetProjection projectTargetPhase( std::uint64_t before, std::uint64_t ingestPeak, std::uin
  • src/pathroute.h bugprone-easily-swappable-parameters inline PathRouteChains pathRouteChains( const IngestResult& ing, const Graph& g, const PathPairs& pp
  • src/quality.h bugprone-easily-swappable-parameters inline bool numericRegressionIsMajor( std::uint32_t was, std::uint32_t now, std::uint32_t bar, std::
  • src/recall.h bugprone-easily-swappable-parameters inline std::vector<float> recallOwnProseEvidence( const IngestResult& ing, const std::vector<std::ui
  • src/recall.h bugprone-easily-swappable-parameters inline std::vector<std::uint32_t> recallHeadingSections( const IngestResult& ing, std::size_t scored
  • src/receiverevidence.h bugprone-easily-swappable-parameters NodeId goQualifiedClass( std::uint32_t fileId, std::string_view whole, std::string_view cls ) const
  • src/receiverevidence.h bugprone-easily-swappable-parameters NodeId rustClassAt( std::uint32_t f, std::uint32_t at, std::string_view modPath, std::string_view cl
  • src/receiverevidence.h bugprone-easily-swappable-parameters void rustFollowReexports( std::uint32_t mf, const AtLevel& atLevel, std::string_view cls, int depth,
  • src/resolve.h bugprone-easily-swappable-parameters inline bool derivesFromName( std::string_view derived, std::string_view base, const ChaUpNames& chaU
  • src/resolve.h bugprone-easily-swappable-parameters inline std::uint32_t resolveRustImport( std::string_view includerPath, std::string_view target,
  • src/resolve.h bugprone-easily-swappable-parameters inline void indexCanonicalScope( HashMap<std::string, rw::SmallVec<NodeId, 2>>& byScope, HashMap<std
  • src/serialize.h bugprone-easily-swappable-parameters inline std::string pricedRootAttr( std::size_t markupBytes, double markupRate, std::size_t bodyBytes
  • src/testmap.h bugprone-exception-escape const auto groupable = [ & ]( std::uint32_t i ) noexcept
  • src/verbs_for.h bugprone-easily-swappable-parameters inline std::string forLensJsonTailStanza( const rw::FileTail& tail, std::size_t tokenBudget, std::si
  • ... and 1 more (see the run's tidy-advisory artifact)
Regenerate / triage

Download the tidy-advisory artifact of the run above. tidy-advisory-baseline-candidate.txt is the full sorted key list; tidy-advisory-diff.txt is the NEW / GONE listing. Commit the rows you accept to .clang-tidy-baseline.txt and delete the fixed ones. This issue is updated by each nightly run and closed by the first run with no NEW rows.

Lingua principale
C++
Stelle
2.6k
Fork
182
Merge medio
21h 12m
PR unite (30g)
262

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di redhat-et/ripwire

Tutte le issue di redhat-et/ripwire

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.