{"record":{"id":"da32e463b1af96d1","repo":"FoundationAgents/MetaGPT","slug":"not-implement-val","errorCode":null,"errorMessage":"Not implement:{val}","messagePattern":"Not implement:(.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"warning","filePath":"metagpt/repo_parser.py","lineNumber":580,"sourceCode":"                \"module\": x.module,\n                \"names\": [RepoParser._parse_name(n) for n in x.names],\n            },\n            any_to_str(ast.If): RepoParser._parse_if,\n            any_to_str(ast.AsyncFunctionDef): lambda x: x.name,\n            any_to_str(ast.AnnAssign): lambda x: RepoParser._parse_variable(x.target),\n        }\n        func = mappings.get(any_to_str(node))\n        if func:\n            code_block = CodeBlockInfo(lineno=node.lineno, end_lineno=node.end_lineno, type_name=any_to_str(node))\n            val = func(node)\n            if isinstance(val, dict):\n                code_block.properties = val\n            elif isinstance(val, list):\n                code_block.tokens = val\n            elif isinstance(val, str):\n                code_block.tokens = [val]\n            else:\n                raise NotImplementedError(f\"Not implement:{val}\")\n            return code_block\n        logger.warning(f\"Unsupported code block:{node.lineno}, {node.end_lineno}, {any_to_str(node)}\")\n        return None\n\n    @staticmethod\n    def _parse_expr(node) -> List:\n        \"\"\"\n        Parses an expression Abstract Syntax Tree (AST) node.\n\n        Args:\n            node: The AST node representing an expression.\n\n        Returns:\n            List: A list containing the parsed information from the expression node.\n        \"\"\"\n        funcs = {\n            any_to_str(ast.Constant): lambda x: [any_to_str(x.value), RepoParser._parse_variable(x.value)],\n            any_to_str(ast.Call): lambda x: [any_to_str(x.value), RepoParser._parse_variable(x.value.func)],","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/FoundationAgents/MetaGPT/blob/11cdf466d042aece04fc6cfd13b28e1a70341b1f/metagpt/repo_parser.py#L562-L598","documentation":"RepoParser._parse_code_block dispatches on the AST node type via a mappings dict; each handler must return a dict (properties), list (tokens), or str (token). If a handler returns any other type, this NotImplementedError is raised with the unexpected value. It marks unhandled AST shapes in the code-block property extractor.","triggerScenarios":"Parsing a Python file whose AST contains a node type whose handler (e.g. a docstring/annotation parser) returns None or another unsupported type; typically triggered by calling RepoParser.generate_characters or _parse_code_block over third-party or unusual source files.","commonSituations":"Running repo parsing / code review flows over codebases with syntax the handlers do not fully cover; new Python syntax features producing AST shapes the handlers return None for; version drift in the handlers' return contracts.","solutions":["Identify the file being parsed (enable logging around RepoParser calls) and simplify or exclude the offending file","Update or patch the specific handler in mappings to always return dict/list/str (e.g. return {} or [] instead of None)","Skip non-project/vendor directories when invoking the parser"],"exampleFix":"// before\ndef _parse_annassign(node):\n    return None  # leads to NotImplementedError\n\n// after\ndef _parse_annassign(node):\n    return []  # or {} — a supported container type","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    blocks = parser._parse_code_block(node)\nexcept NotImplementedError:\n    blocks = None  # parser coverage gap; skip this node rather than abort the scan","preventionTips":["Limit RepoParser scope to first-party code, exclude vendor/generated dirs","If you control the handlers, make every handler return dict/list/str unconditionally","Log skipped files so coverage gaps are visible instead of fatal"],"tags":["ast","parser","repo-analysis"],"backgroundTag":null,"analyzedSha":"11cdf466d042aece04fc6cfd13b28e1a70341b1f","analyzedAt":"2026-08-14T23:20:02.994Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}