{"record":{"id":"51eee32bac3b5c63","repo":"Morganamilo/paru","slug":"not-yet-implemented","errorCode":null,"errorMessage":"not yet implemented","messagePattern":"not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/mock.rs","lineNumber":100,"sourceCode":"        pkgs: &[S],\n    ) -> StdResult<Vec<Package>, Error> {\n        let mut ret = Vec::new();\n\n        for pkg in pkgs {\n            if let Some(pkg) = self.pkgs.get(pkg.as_ref()) {\n                ret.push(pkg.clone());\n            }\n        }\n\n        Ok(ret)\n    }\n\n    async fn search_by<S: AsRef<str> + Send + Sync>(\n        &self,\n        _pkg: S,\n        _by: SearchBy,\n    ) -> StdResult<Vec<Package>, Error> {\n        unimplemented!()\n    }\n}\n","sourceCodeStart":82,"sourceCodeEnd":103,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/mock.rs#L82-L103","documentation":"This error is a Rust `unimplemented!()` panic placeholder in the mock backend's `search_by` method. It means the mock implementation of the package-search trait was never fleshed out, so any call to `search_by` aborts the task instead of returning a real `Error`. It exists purely as a stub to satisfy the trait signature.","triggerScenarios":"Calling `search_by` on the mock backend defined in src/mock.rs (e.g. unit tests or code paths that route to the mock rather than a real backend). Any search performed against this mock hits the stub at src/mock.rs:100.","commonSituations":"Developers wiring up the mock in tests without realizing search is not mocked; integration code accidentally selecting the mock backend in production-like configurations.","solutions":["Implement the `search_by` body in src/mock.rs to return canned/deserialized `Package` data instead of `unimplemented!()`","Route tests/code to a real backend implementation rather than the mock","If search is intentionally unsupported by the mock, return `Err(Error::...)` explicitly instead of panicking with `unimplemented!()`"],"exampleFix":"// before\nasync fn search_by<S: AsRef<str> + Send + Sync>(&self, _pkg: S, _by: SearchBy) -> StdResult<Vec<Package>, Error> {\n    unimplemented!()\n}\n// after\nasync fn search_by<S: AsRef<str> + Send + Sync>(&self, pkg: S, by: SearchBy) -> StdResult<Vec<Package>, Error> {\n    Ok(self.packages.iter().filter(|p| p.matches(pkg.as_ref(), &by)).cloned().collect())\n}","handlingStrategy":"try-catch","validationCode":"// Check backend type before searching\nfn supports_search(backend: &dyn PkgBackend) -> bool {\n    backend.as_any().type_id() != TypeId::of::<MockBackend>()\n}","typeGuard":"fn is_mock(backend: &dyn PkgBackend) -> bool {\n    backend.as_any().downcast_ref::<MockBackend>().is_some()\n}","tryCatchPattern":"if is_mock(backend) {\n    return Ok(Vec::new()); // or use a fixture-based search\n}\nlet results = backend.search_by(\"ripgrep\", SearchBy::Name).await?;","preventionTips":["Never leave `unimplemented!()` in trait methods used by integration tests","Implement mock bodies returning fixture data, or return a typed Unsupported error","Add a compile-time/test-time assertion that every trait method is exercised in CI"],"tags":["mock","unimplemented","search","panic"],"backgroundTag":"method-not-implemented","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}