|
1425 | 1425 | "id": "40749cdc", |
1426 | 1426 | "metadata": {}, |
1427 | 1427 | "outputs": [], |
1428 | | - "source": [] |
| 1428 | + "source": [ |
| 1429 | + "# Export Radon data for comparison analysis\n", |
| 1430 | + "print(\"\\n\" + \"🔄\" * 3 + \" EXPORTING RADON DATA FOR COMPARISON \" + \"🔄\" * 3)\n", |
| 1431 | + "\n", |
| 1432 | + "# Export Radon Cyclomatic Complexity data\n", |
| 1433 | + "if not radon_cc_results.empty:\n", |
| 1434 | + " # Prepare complexity data in the expected format\n", |
| 1435 | + " complexity_export = radon_cc_results[['file', 'function', 'line', 'complexity', 'rank', 'type']].copy()\n", |
| 1436 | + " \n", |
| 1437 | + " # Save to CSV\n", |
| 1438 | + " complexity_file = \"radon_complexity.csv\"\n", |
| 1439 | + " complexity_export.to_csv(complexity_file, index=False)\n", |
| 1440 | + " \n", |
| 1441 | + " print(f\"✅ Exported Radon Complexity data: {complexity_file}\")\n", |
| 1442 | + " print(f\" 📊 {len(complexity_export)} functions/methods exported\")\n", |
| 1443 | + " print(f\" 📈 Average complexity: {complexity_export['complexity'].mean():.2f}\")\n", |
| 1444 | + " print(f\" 🎯 Complexity range: {complexity_export['complexity'].min()} - {complexity_export['complexity'].max()}\")\n", |
| 1445 | + "else:\n", |
| 1446 | + " print(\"⚠️ No Radon complexity data available for export\")\n", |
| 1447 | + "\n", |
| 1448 | + "# Export Radon Maintainability Index data \n", |
| 1449 | + "if not radon_mi_results.empty:\n", |
| 1450 | + " # Prepare maintainability data in the expected format\n", |
| 1451 | + " maintainability_export = radon_mi_results[['file', 'mi_score', 'mi_rank']].copy()\n", |
| 1452 | + " \n", |
| 1453 | + " # Save to CSV\n", |
| 1454 | + " maintainability_file = \"radon_maintainability.csv\"\n", |
| 1455 | + " maintainability_export.to_csv(maintainability_file, index=False)\n", |
| 1456 | + " \n", |
| 1457 | + " print(f\"\\n✅ Exported Radon Maintainability data: {maintainability_file}\")\n", |
| 1458 | + " print(f\" 📊 {len(maintainability_export)} files exported\")\n", |
| 1459 | + " print(f\" 📈 Average MI score: {maintainability_export['mi_score'].mean():.2f}\")\n", |
| 1460 | + " print(f\" 🎯 MI score range: {maintainability_export['mi_score'].min():.1f} - {maintainability_export['mi_score'].max():.1f}\")\n", |
| 1461 | + "else:\n", |
| 1462 | + " print(\"⚠️ No Radon maintainability data available for export\")\n", |
| 1463 | + "\n", |
| 1464 | + "# Summary of all exported files\n", |
| 1465 | + "print(f\"\\n📁 EXPORTED FILES SUMMARY:\")\n", |
| 1466 | + "exported_files = []\n", |
| 1467 | + "\n", |
| 1468 | + "if Path(\"code_quality_summary.csv\").exists():\n", |
| 1469 | + " exported_files.append(\"code_quality_summary.csv\")\n", |
| 1470 | + " print(f\" ✅ code_quality_summary.csv\")\n", |
| 1471 | + "\n", |
| 1472 | + "if Path(\"detailed_issues.csv\").exists():\n", |
| 1473 | + " exported_files.append(\"detailed_issues.csv\") \n", |
| 1474 | + " print(f\" ✅ detailed_issues.csv\")\n", |
| 1475 | + "\n", |
| 1476 | + "if Path(\"radon_complexity.csv\").exists():\n", |
| 1477 | + " exported_files.append(\"radon_complexity.csv\")\n", |
| 1478 | + " print(f\" ✅ radon_complexity.csv\")\n", |
| 1479 | + " \n", |
| 1480 | + "if Path(\"radon_maintainability.csv\").exists():\n", |
| 1481 | + " exported_files.append(\"radon_maintainability.csv\")\n", |
| 1482 | + " print(f\" ✅ radon_maintainability.csv\")\n", |
| 1483 | + "\n", |
| 1484 | + "print(f\"\\n🎯 Ready for comparison analysis!\")\n", |
| 1485 | + "print(f\" Total files exported: {len(exported_files)}\")\n", |
| 1486 | + "print(f\" 🚀 Copy these CSV files to your implementation directory in:\")\n", |
| 1487 | + "print(f\" code_quality_comparison/data/[your_implementation_name]/\")\n", |
| 1488 | + "print(f\"\\n💡 Tip: Run the code_quality_comparison.ipynb notebook to compare multiple implementations!\")" |
| 1489 | + ] |
1429 | 1490 | } |
1430 | 1491 | ], |
1431 | 1492 | "metadata": { |
|
0 commit comments