@loxia-labs/loxia-autopilot-one 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/cli.js +1 -1
- package/bin/loxia-terminal-v2.js +1 -1
- package/bin/loxia-terminal.js +1 -1
- package/bin/start-with-terminal.js +1 -1
- package/package.json +1 -1
- package/scripts/install-scanners.js +1 -1
- package/src/analyzers/CSSAnalyzer.js +1 -1
- package/src/analyzers/ConfigValidator.js +1 -1
- package/src/analyzers/ESLintAnalyzer.js +1 -1
- package/src/analyzers/JavaScriptAnalyzer.js +1 -1
- package/src/analyzers/PrettierFormatter.js +1 -1
- package/src/analyzers/PythonAnalyzer.js +1 -1
- package/src/analyzers/SecurityAnalyzer.js +1 -1
- package/src/analyzers/TypeScriptAnalyzer.js +1 -1
- package/src/analyzers/codeCloneDetector/analyzer.js +1 -1
- package/src/analyzers/codeCloneDetector/detector.js +1 -1
- package/src/analyzers/codeCloneDetector/index.js +1 -1
- package/src/analyzers/codeCloneDetector/parser.js +1 -1
- package/src/analyzers/codeCloneDetector/reporter.js +1 -1
- package/src/analyzers/codeCloneDetector/scanner.js +1 -1
- package/src/core/agentPool.js +1 -1
- package/src/core/agentScheduler.js +1 -1
- package/src/core/contextManager.js +1 -1
- package/src/core/messageProcessor.js +1 -1
- package/src/core/orchestrator.js +1 -1
- package/src/core/stateManager.js +1 -1
- package/src/index.js +1 -1
- package/src/interfaces/cli.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/advancedFeatures.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/agentControl.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/agents.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/components.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/connection.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/enhancements.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/imports.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/messages.test.js +1 -1
- package/src/interfaces/terminal/__tests__/smoke/tools.test.js +1 -1
- package/src/interfaces/terminal/api/apiClient.js +1 -1
- package/src/interfaces/terminal/api/messageRouter.js +1 -1
- package/src/interfaces/terminal/api/session.js +1 -1
- package/src/interfaces/terminal/api/websocket.js +1 -1
- package/src/interfaces/terminal/components/AgentCreator.js +1 -1
- package/src/interfaces/terminal/components/AgentEditor.js +1 -1
- package/src/interfaces/terminal/components/AgentSwitcher.js +1 -1
- package/src/interfaces/terminal/components/ErrorBoundary.js +1 -1
- package/src/interfaces/terminal/components/ErrorPanel.js +1 -1
- package/src/interfaces/terminal/components/Header.js +1 -1
- package/src/interfaces/terminal/components/HelpPanel.js +1 -1
- package/src/interfaces/terminal/components/InputBox.js +1 -1
- package/src/interfaces/terminal/components/Layout.js +1 -1
- package/src/interfaces/terminal/components/LoadingSpinner.js +1 -1
- package/src/interfaces/terminal/components/MessageList.js +1 -1
- package/src/interfaces/terminal/components/MultilineTextInput.js +1 -1
- package/src/interfaces/terminal/components/SearchPanel.js +1 -1
- package/src/interfaces/terminal/components/SettingsPanel.js +1 -1
- package/src/interfaces/terminal/components/StatusBar.js +1 -1
- package/src/interfaces/terminal/components/TextInput.js +1 -1
- package/src/interfaces/terminal/config/agentEditorConstants.js +1 -1
- package/src/interfaces/terminal/config/constants.js +1 -1
- package/src/interfaces/terminal/index.js +1 -1
- package/src/interfaces/terminal/state/useAgentControl.js +1 -1
- package/src/interfaces/terminal/state/useAgents.js +1 -1
- package/src/interfaces/terminal/state/useConnection.js +1 -1
- package/src/interfaces/terminal/state/useMessages.js +1 -1
- package/src/interfaces/terminal/state/useTools.js +1 -1
- package/src/interfaces/terminal/utils/debugLogger.js +1 -1
- package/src/interfaces/terminal/utils/settingsStorage.js +1 -1
- package/src/interfaces/terminal/utils/theme.js +1 -1
- package/src/interfaces/webServer.js +1 -1
- package/src/modules/fileExplorer/controller.js +1 -1
- package/src/modules/fileExplorer/index.js +1 -1
- package/src/modules/fileExplorer/middleware.js +1 -1
- package/src/modules/fileExplorer/routes.js +1 -1
- package/src/services/aiService.js +1 -1
- package/src/services/apiKeyManager.js +1 -1
- package/src/services/benchmarkService.js +1 -1
- package/src/services/budgetService.js +1 -1
- package/src/services/contextInjectionService.js +1 -1
- package/src/services/conversationCompactionService.js +1 -1
- package/src/services/errorHandler.js +1 -1
- package/src/services/fileAttachmentService.js +1 -1
- package/src/services/modelRouterService.js +1 -1
- package/src/services/modelsService.js +1 -1
- package/src/services/qualityInspector.js +1 -1
- package/src/services/tokenCountingService.js +1 -1
- package/src/tools/agentCommunicationTool.js +1 -1
- package/src/tools/agentDelayTool.js +1 -1
- package/src/tools/asyncToolManager.js +1 -1
- package/src/tools/baseTool.js +1 -1
- package/src/tools/browserTool.js +1 -1
- package/src/tools/cloneDetectionTool.js +1 -1
- package/src/tools/dependencyResolverTool.js +1 -1
- package/src/tools/fileContentReplaceTool.js +1 -1
- package/src/tools/fileSystemTool.js +1 -1
- package/src/tools/fileTreeTool.js +1 -1
- package/src/tools/imageTool.js +1 -1
- package/src/tools/importAnalyzerTool.js +1 -1
- package/src/tools/jobDoneTool.js +1 -1
- package/src/tools/seekTool.js +1 -1
- package/src/tools/staticAnalysisTool.js +1 -1
- package/src/tools/taskManagerTool.js +1 -1
- package/src/tools/terminalTool.js +1 -1
- package/src/tools/webTool.js +1 -1
- package/src/types/agent.js +1 -1
- package/src/types/contextReference.js +1 -1
- package/src/types/conversation.js +1 -1
- package/src/types/toolCommand.js +1 -1
- package/src/utilities/attachmentValidator.js +1 -1
- package/src/utilities/configManager.js +1 -1
- package/src/utilities/constants.js +1 -1
- package/src/utilities/directoryAccessManager.js +1 -1
- package/src/utilities/fileProcessor.js +1 -1
- package/src/utilities/logger.js +1 -1
- package/src/utilities/tagParser.js +1 -1
- package/src/utilities/toolConstants.js +1 -1
- package/web-ui/build/index.html +2 -2
- package/web-ui/build/static/{index-lCBai6dX.js → index-CX8ZfpGw.js} +113 -60
- package/web-ui/build/static/index-Dwg_JrlO.css +1 -0
- package/web-ui/build/static/index-CClD1090.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a0_0x17b811=a0_0x4d63;(function(_0x23a779,_0x3a45d5){const _0x5cc8d3=a0_0x4d63,_0x20c33f=_0x23a779();while(!![]){try{const _0xba501a=parseInt(_0x5cc8d3(0x1b0))/0x1+-parseInt(_0x5cc8d3(0x1ad))/0x2+-parseInt(_0x5cc8d3(0x1bf))/0x3*(parseInt(_0x5cc8d3(0x1a9))/0x4)+-parseInt(_0x5cc8d3(0x1b4))/0x5*(parseInt(_0x5cc8d3(0x1a7))/0x6)+-parseInt(_0x5cc8d3(0x1c1))/0x7*(-parseInt(_0x5cc8d3(0x19e))/0x8)+-parseInt(_0x5cc8d3(0x1ba))/0x9*(parseInt(_0x5cc8d3(0x1c5))/0xa)+-parseInt(_0x5cc8d3(0x1bc))/0xb*(-parseInt(_0x5cc8d3(0x193))/0xc);if(_0xba501a===_0x3a45d5)break;else _0x20c33f['push'](_0x20c33f['shift']());}catch(_0x24457c){_0x20c33f['push'](_0x20c33f['shift']());}}}(a0_0x2c25,0xd268c));function a0_0x4d63(_0x4f9831,_0x312325){_0x4f9831=_0x4f9831-0x193;const _0x2c256d=a0_0x2c25();let _0x4d6357=_0x2c256d[_0x4f9831];if(a0_0x4d63['cKcoDH']===undefined){var _0x547855=function(_0x261883){const _0xc0523c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1e4065='',_0x485852='';for(let _0x2e0bd8=0x0,_0x38ed7a,_0x4203ec,_0x36725b=0x0;_0x4203ec=_0x261883['charAt'](_0x36725b++);~_0x4203ec&&(_0x38ed7a=_0x2e0bd8%0x4?_0x38ed7a*0x40+_0x4203ec:_0x4203ec,_0x2e0bd8++%0x4)?_0x1e4065+=String['fromCharCode'](0xff&_0x38ed7a>>(-0x2*_0x2e0bd8&0x6)):0x0){_0x4203ec=_0xc0523c['indexOf'](_0x4203ec);}for(let _0x234fcc=0x0,_0x75d7a=_0x1e4065['length'];_0x234fcc<_0x75d7a;_0x234fcc++){_0x485852+='%'+('00'+_0x1e4065['charCodeAt'](_0x234fcc)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x485852);};a0_0x4d63['KCoJYN']=_0x547855,a0_0x4d63['WGICOa']={},a0_0x4d63['cKcoDH']=!![];}const _0x5098bc=_0x2c256d[0x0],_0x379060=_0x4f9831+_0x5098bc,_0x127706=a0_0x4d63['WGICOa'][_0x379060];return!_0x127706?(_0x4d6357=a0_0x4d63['KCoJYN'](_0x4d6357),a0_0x4d63['WGICOa'][_0x379060]=_0x4d6357):_0x4d6357=_0x127706,_0x4d6357;}import a0_0x1e4065 from'typescript';import a0_0x485852 from'path';import{STATIC_ANALYSIS}from'../utilities/constants.js';class JavaScriptAnalyzer{constructor(_0x2e0bd8=null){const _0x375f9b=a0_0x4d63;this['logger']=_0x2e0bd8,this[_0x375f9b(0x1af)]={'allowJs':!![],'checkJs':!![],'noEmit':!![],'jsx':a0_0x1e4065[_0x375f9b(0x1b2)][_0x375f9b(0x1a4)],'target':a0_0x1e4065[_0x375f9b(0x1c3)]['Latest'],'module':a0_0x1e4065['ModuleKind'][_0x375f9b(0x1c4)],'moduleResolution':a0_0x1e4065[_0x375f9b(0x1bd)][_0x375f9b(0x19a)],'esModuleInterop':!![],'skipLibCheck':!![],'strict':![],'noImplicitAny':![]};}async['analyze'](_0x38ed7a,_0x4203ec,_0x36725b={}){const _0x395c3a=a0_0x4d63;try{const _0x234fcc=[],_0x75d7a=a0_0x1e4065['createSourceFile'](_0x38ed7a,_0x4203ec,a0_0x1e4065[_0x395c3a(0x1c3)][_0x395c3a(0x199)],!![]),_0x5ab48e=this['getSyntacticDiagnostics'](_0x75d7a);_0x234fcc[_0x395c3a(0x1a5)](..._0x5ab48e);const _0x484d22=await this[_0x395c3a(0x1b7)](_0x38ed7a,_0x4203ec);return _0x234fcc['push'](..._0x484d22),this[_0x395c3a(0x1a6)]?.['debug']('JavaScript\x20analysis\x20completed',{'file':_0x38ed7a,'totalDiagnostics':_0x234fcc['length'],'errors':_0x234fcc['filter'](_0x4ffdc4=>_0x4ffdc4[_0x395c3a(0x1b9)]===STATIC_ANALYSIS[_0x395c3a(0x19d)][_0x395c3a(0x1a8)])['length'],'warnings':_0x234fcc[_0x395c3a(0x1bb)](_0x3ea523=>_0x3ea523[_0x395c3a(0x1b9)]===STATIC_ANALYSIS['SEVERITY']['WARNING'])['length']}),_0x234fcc;}catch(_0x455a60){return this['logger']?.[_0x395c3a(0x1c7)]('JavaScript\x20analysis\x20failed',{'file':_0x38ed7a,'error':_0x455a60['message']}),[{'file':_0x38ed7a,'line':0x0,'column':0x0,'severity':STATIC_ANALYSIS[_0x395c3a(0x19d)]['ERROR'],'rule':_0x395c3a(0x1aa),'message':_0x395c3a(0x1b3)+_0x455a60[_0x395c3a(0x196)],'category':STATIC_ANALYSIS['CATEGORY']['SYNTAX']}];}}['getSyntacticDiagnostics'](_0x3392f3){const _0x773a1e=a0_0x4d63,_0x2e7789=[],_0x2d167a=_0xf77822=>{const _0x36b116=a0_0x4d63;if(_0xf77822[_0x36b116(0x1a2)]===a0_0x1e4065[_0x36b116(0x1ae)][_0x36b116(0x1c0)]){const _0xdcc5c7=_0x3392f3[_0x36b116(0x1a0)](_0xf77822[_0x36b116(0x1c2)]());_0x2e7789[_0x36b116(0x1a5)]({'file':_0x3392f3['fileName'],'line':_0xdcc5c7['line']+0x1,'column':_0xdcc5c7['character']+0x1,'severity':STATIC_ANALYSIS[_0x36b116(0x19d)]['ERROR'],'rule':_0x36b116(0x1b1),'message':_0x36b116(0x19c),'category':STATIC_ANALYSIS['CATEGORY']['SYNTAX'],'fixable':![]});}a0_0x1e4065[_0x36b116(0x1ac)](_0xf77822,_0x2d167a);};_0x2d167a(_0x3392f3);if(_0x3392f3[_0x773a1e(0x19f)]&&_0x3392f3[_0x773a1e(0x19f)]['length']>0x0)for(const _0x37d56e of _0x3392f3['parseDiagnostics']){_0x2e7789[_0x773a1e(0x1a5)](this['formatDiagnostic'](_0x37d56e,_0x3392f3));}return _0x2e7789;}async[a0_0x17b811(0x1b7)](_0x105649,_0x301d0d){const _0x52a441=a0_0x17b811,_0x4a1ce0=[];try{const _0x47c1b2=a0_0x1e4065['createSourceFile'](_0x105649,_0x301d0d,a0_0x1e4065['ScriptTarget'][_0x52a441(0x199)],!![]),_0x87eabc={'getSourceFile':_0xc97a2d=>{if(_0xc97a2d===_0x105649)return _0x47c1b2;return undefined;},'getDefaultLibFileName':()=>'lib.d.ts','writeFile':()=>{},'getCurrentDirectory':()=>a0_0x485852['dirname'](_0x105649),'getDirectories':()=>[],'fileExists':_0x23c37c=>_0x23c37c===_0x105649,'readFile':_0x43c9b5=>{if(_0x43c9b5===_0x105649)return _0x301d0d;return undefined;},'getCanonicalFileName':_0x2fc714=>_0x2fc714,'useCaseSensitiveFileNames':()=>!![],'getNewLine':()=>'\x0a'},_0x3ea49d=a0_0x1e4065['createProgram']({'rootNames':[_0x105649],'options':this[_0x52a441(0x1af)],'host':_0x87eabc}),_0x189e27=_0x3ea49d['getSemanticDiagnostics'](_0x47c1b2);for(const _0x47b68a of _0x189e27){_0x4a1ce0[_0x52a441(0x1a5)](this['formatDiagnostic'](_0x47b68a,_0x47c1b2));}}catch(_0x23d1e0){this[_0x52a441(0x1a6)]?.[_0x52a441(0x197)]('Semantic\x20analysis\x20skipped',{'file':_0x105649,'reason':_0x23d1e0['message']});}return _0x4a1ce0;}['formatDiagnostic'](_0x37bbed,_0xb5e5e2){const _0xc0202d=a0_0x17b811;let _0x41108=0x0,_0x405370=0x0;if(_0x37bbed['file']&&_0x37bbed['start']!==undefined){const _0x43dc30=_0x37bbed['file']['getLineAndCharacterOfPosition'](_0x37bbed[_0xc0202d(0x1c6)]);_0x41108=_0x43dc30[_0xc0202d(0x1c9)]+0x1,_0x405370=_0x43dc30[_0xc0202d(0x1b8)]+0x1;}else{if(_0xb5e5e2&&_0x37bbed['start']!==undefined){const _0x32cde2=_0xb5e5e2['getLineAndCharacterOfPosition'](_0x37bbed['start']);_0x41108=_0x32cde2[_0xc0202d(0x1c9)]+0x1,_0x405370=_0x32cde2['character']+0x1;}}const _0x40f22d=a0_0x1e4065['flattenDiagnosticMessageText'](_0x37bbed['messageText'],'\x0a');let _0x398c9c;switch(_0x37bbed['category']){case a0_0x1e4065[_0xc0202d(0x1a3)]['Error']:_0x398c9c=STATIC_ANALYSIS[_0xc0202d(0x19d)]['ERROR'];break;case a0_0x1e4065[_0xc0202d(0x1a3)][_0xc0202d(0x1c8)]:_0x398c9c=STATIC_ANALYSIS[_0xc0202d(0x19d)][_0xc0202d(0x1be)];break;case a0_0x1e4065['DiagnosticCategory']['Message']:case a0_0x1e4065['DiagnosticCategory']['Suggestion']:_0x398c9c=STATIC_ANALYSIS['SEVERITY'][_0xc0202d(0x194)];break;default:_0x398c9c=STATIC_ANALYSIS['SEVERITY'][_0xc0202d(0x1a8)];}let _0x5ac4a4=STATIC_ANALYSIS[_0xc0202d(0x1a1)]['SYNTAX'];const _0x395a0b=_0x37bbed[_0xc0202d(0x1b5)];if(_0x395a0b>=0x7d0&&_0x395a0b<0xbb8)_0x5ac4a4=STATIC_ANALYSIS['CATEGORY']['TYPE'];else{if(_0x395a0b>=0x3e8&&_0x395a0b<0x7d0)_0x5ac4a4=STATIC_ANALYSIS[_0xc0202d(0x1a1)]['SYNTAX'];else _0x395a0b>=0x8fc&&_0x395a0b<0x960&&(_0x5ac4a4=STATIC_ANALYSIS['CATEGORY']['IMPORT']);}return(_0x40f22d[_0xc0202d(0x1ab)]()[_0xc0202d(0x198)]('cannot\x20find\x20module')||_0x40f22d[_0xc0202d(0x1ab)]()['includes']('import'))&&(_0x5ac4a4=STATIC_ANALYSIS['CATEGORY'][_0xc0202d(0x195)]),{'file':_0x37bbed['file']?.[_0xc0202d(0x1b6)]||_0xb5e5e2?.[_0xc0202d(0x1b6)]||_0xc0202d(0x19b),'line':_0x41108,'column':_0x405370,'severity':_0x398c9c,'rule':'TS'+_0x395a0b,'message':_0x40f22d,'category':_0x5ac4a4,'fixable':![],'code':_0x37bbed[_0xc0202d(0x1b5)]};}}export default JavaScriptAnalyzer;function a0_0x2c25(){const _0x5b21e9=['BgLUzq','mJrcDejqwMW','su5gtW','su1qt1ju','BwvZC2fNzq','zgvIDwC','Aw5JBhvKzxm','tgf0zxn0','tM9KzuPZ','Dw5RBM93BG','u3LUDgf4igvYCM9Y','u0vwrvjjvfK','ndbJsxDqDe0','CgfYC2veAwfNBM9ZDgLJCW','z2v0tgLUzufUzenOyxjHy3rLCK9Mug9ZAxrPB24','q0furuDpuLK','A2LUza','rgLHz25VC3rPy0nHDgvNB3j5','uMvHy3q','ChvZAa','Bg9Nz2vY','mJe0ndr5AwLgs0i','rvjst1i','nfvmBwDvzq','yw5HBhL6zxiTzxjYB3i','Dg9mB3DLCKnHC2u','zM9YrwfJAenOAwXK','nteWotyWz3Pjs25s','u3LUDgf4s2LUza','y29TCgLSzxjpChrPB25Z','mtq2otC1nejmEMzsAW','C3LUDgf4lwvYCM9Y','sNn4rw1PDa','qw5HBhLZAxmGzMfPBgvKoIa','otG1yvb4r0nM','y29Kzq','zMLSzu5HBwu','z2v0u2vTyw50AwneAwfNBM9ZDgLJCW','y2HHCMfJDgvY','C2v2zxjPDhK','mtmZnJuWovbwuwfvEG','zMLSDgvY','mte5mtq5ntHRA0z2t0q','tw9KDwXLuMvZB2X1DgLVBKTPBMq','v0fstKLorW','nduZodq4mxfcrNjRzq','vw5RBM93BG','nda4otyXrffZr2vu','z2v0u3rHCNq','u2nYAxb0vgfYz2v0','rvnozxH0','ndb6A01QuKe','C3rHCNq','zxjYB3i','v2fYBMLUzW'];a0_0x2c25=function(){return _0x5b21e9;};return a0_0x2c25();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a0_0x401c(_0x5f261c,_0x432528){_0x5f261c=_0x5f261c-0x1c5;const _0x70bee5=a0_0x70be();let _0x401c47=_0x70bee5[_0x5f261c];if(a0_0x401c['WJzuBk']===undefined){var _0x3400ac=function(_0x277be9){const _0x1c2a29='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x58db76='',_0x4d46f6='';for(let _0x43f8c3=0x0,_0x553eb9,_0x10b0ca,_0x2c1228=0x0;_0x10b0ca=_0x277be9['charAt'](_0x2c1228++);~_0x10b0ca&&(_0x553eb9=_0x43f8c3%0x4?_0x553eb9*0x40+_0x10b0ca:_0x10b0ca,_0x43f8c3++%0x4)?_0x58db76+=String['fromCharCode'](0xff&_0x553eb9>>(-0x2*_0x43f8c3&0x6)):0x0){_0x10b0ca=_0x1c2a29['indexOf'](_0x10b0ca);}for(let _0x4097f7=0x0,_0x5170a0=_0x58db76['length'];_0x4097f7<_0x5170a0;_0x4097f7++){_0x4d46f6+='%'+('00'+_0x58db76['charCodeAt'](_0x4097f7)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d46f6);};a0_0x401c['gcgscX']=_0x3400ac,a0_0x401c['XvUrMs']={},a0_0x401c['WJzuBk']=!![];}const _0x5ae251=_0x70bee5[0x0],_0x1108ad=_0x5f261c+_0x5ae251,_0x530dea=a0_0x401c['XvUrMs'][_0x1108ad];return!_0x530dea?(_0x401c47=a0_0x401c['gcgscX'](_0x401c47),a0_0x401c['XvUrMs'][_0x1108ad]=_0x401c47):_0x401c47=_0x530dea,_0x401c47;}const a0_0x636af0=a0_0x401c;function a0_0x70be(){const _0x27856d=['lNLTBa','CMvTB3zLza','C2v0','lNrZ','mJGYrNL2BMPL','y29UzMLNq2fJAgu','Bw9KAwzPzwq','ntmWt21ACuDi','yMfIzwW','lNrZEa','ChvZAa','EwfTBa','AhrTBa','mZq2n251CKfnva','otC5ndaWB3jSthfq','D29YA2LUz0rPCG','mte3mJy1mLvLwKjfuW','zgLYBMfTzq','rM91BMqGuhjLDhrPzxiGy29UzMLN','y291BNrdAgfUz2vKtgLUzxm','zM9YBwf0','mta5odu3m3frDLfQsq','nti3nevTrKnXEq','DhLWzxnJCMLWDa','lMXLC3m','C3bSAxq','ANnVBG','ndmYndqXow9nAg9YEG','lMnQCW','zxm1','zgvIDwC','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','ywrKzwq','uhjLDhrPzxiGzM9YBwf0DgLUzYbMywLSzwq','BwvZC2fNzq','oty0mtu4mhfdwe1Xzq','uhjLDhrPzxiGzM9YBwf0DgLUzYbMywLSzwq6ia','zxH0BMfTzq','mJr6BwDJA1C','z2v0uhjLDhrPzxjdB25MAwC','Dg9mB3DLCKnHC2u','lMH0BwW','lMPZB24'];a0_0x70be=function(){return _0x27856d;};return a0_0x70be();}(function(_0x5559fe,_0x4f6f38){const _0x19874b=a0_0x401c,_0x1af59b=_0x5559fe();while(!![]){try{const _0xb72cef=-parseInt(_0x19874b(0x1e7))/0x1*(parseInt(_0x19874b(0x1de))/0x2)+parseInt(_0x19874b(0x1ea))/0x3+-parseInt(_0x19874b(0x1e8))/0x4+-parseInt(_0x19874b(0x1e1))/0x5*(parseInt(_0x19874b(0x1c5))/0x6)+-parseInt(_0x19874b(0x1ef))/0x7*(-parseInt(_0x19874b(0x1d5))/0x8)+-parseInt(_0x19874b(0x1ca))/0x9+parseInt(_0x19874b(0x1d2))/0xa;if(_0xb72cef===_0x4f6f38)break;else _0x1af59b['push'](_0x1af59b['shift']());}catch(_0xc8286e){_0x1af59b['push'](_0x1af59b['shift']());}}}(a0_0x70be,0x7e961));import a0_0x58db76 from'prettier';import a0_0x4d46f6 from'path';import a0_0x43f8c3 from'fs/promises';class PrettierFormatter{constructor(_0x553eb9=null){this['logger']=_0x553eb9,this['configCache']=new Map();}async['format'](_0x10b0ca,_0x2c1228,_0x4097f7={}){const _0x12f7da=a0_0x401c;try{const _0x5170a0=await this['getPrettierConfig'](_0x10b0ca,_0x4097f7[_0x12f7da(0x1e9)]),_0x4e9921=this['getParser'](_0x10b0ca),_0x47c824=await a0_0x58db76['format'](_0x2c1228,{..._0x5170a0,'filepath':_0x10b0ca,'parser':_0x4e9921}),_0x5c5048=_0x47c824!==_0x2c1228;return{'formatted':_0x5c5048,'content':_0x47c824,'original':_0x2c1228,'changes':_0x5c5048?this['describeChanges'](_0x2c1228,_0x47c824):[],'linesChanged':_0x5c5048?this['countChangedLines'](_0x2c1228,_0x47c824):0x0};}catch(_0x4337cd){this['logger']?.['error'](_0x12f7da(0x1d0),{'file':_0x10b0ca,'error':_0x4337cd[_0x12f7da(0x1d1)]});throw new Error(_0x12f7da(0x1d3)+_0x4337cd['message']);}}async['check'](_0x881564,_0x327d50,_0x48db02={}){const _0x539b92=a0_0x401c;try{const _0x5406bd=await this[_0x539b92(0x1d6)](_0x881564,_0x48db02['workingDir']),_0x37f3b2=this['getParser'](_0x881564),_0x174c29=await a0_0x58db76[_0x539b92(0x1ee)](_0x327d50,{..._0x5406bd,'filepath':_0x881564,'parser':_0x37f3b2});return _0x174c29!==_0x327d50;}catch(_0x43e6e9){return this['logger']?.['warn']('Prettier\x20check\x20failed',{'file':_0x881564,'error':_0x43e6e9[_0x539b92(0x1d1)]}),![];}}async[a0_0x636af0(0x1d6)](_0x248fd0,_0x2e126c){const _0x42816c=a0_0x636af0,_0x52bc40=_0x2e126c||a0_0x4d46f6[_0x42816c(0x1eb)](_0x248fd0);if(this[_0x42816c(0x1df)]['has'](_0x52bc40))return this['configCache']['get'](_0x52bc40);let _0x4848d1={};if(_0x2e126c)try{const _0x2a3fa6=await a0_0x58db76['resolveConfig'](_0x248fd0,{'config':_0x2e126c});_0x2a3fa6&&(this['logger']?.['debug'](_0x42816c(0x1ec),{'workingDir':_0x2e126c}),_0x4848d1=_0x2a3fa6);}catch(_0x1c51b2){this['logger']?.[_0x42816c(0x1cd)]('No Prettier config found, using defaults');}const defaultConfig={'semi':!![],'singleQuote':!![],'tabWidth':0x2,'trailingComma':_0x42816c(0x1cc),'printWidth':0x64,'arrowParens':'avoid','endOfLine':'lf',..._0x4848d1};return this['configCache'][_0x42816c(0x1dc)](_0x52bc40,defaultConfig),defaultConfig;}['getParser'](_0x4180d1){const _0x255589=a0_0x636af0,_0x15113a=a0_0x4d46f6[_0x255589(0x1d4)](_0x4180d1)[_0x255589(0x1d7)](),_0x13c02f={'.js':'babel','.jsx':'babel','.mjs':_0x255589(0x1e2),'.cjs':_0x255589(0x1e2),'.ts':_0x255589(0x1c6),'.tsx':'typescript','.json':_0x255589(0x1c9),'.json5':'json5','.css':'css','.scss':'scss','.less':'less','.html':_0x255589(0x1e6),'.vue':'vue','.md':'markdown','.yaml':_0x255589(0x1e5),'.yml':_0x255589(0x1e5)};return _0x13c02f[_0x15113a]||'babel';}['describeChanges'](_0x1af001,_0x4b27f9){const _0x4f60dd=a0_0x636af0,_0x9502bf=[],_0x1dc793=_0x1af001[_0x4f60dd(0x1c8)]('\x0a'),_0x3287d5=_0x4b27f9[_0x4f60dd(0x1c8)]('\x0a'),_0x220746=Math['max'](_0x1dc793['length'],_0x3287d5['length']);for(let _0x2b3cc1=0x0;_0x2b3cc1<_0x220746;_0x2b3cc1++){const _0x68c702=_0x1dc793[_0x2b3cc1],_0xc256fc=_0x3287d5[_0x2b3cc1];_0x68c702!==_0xc256fc&&_0x9502bf[_0x4f60dd(0x1e4)]({'line':_0x2b3cc1+0x1,'type':_0x68c702!==undefined&&_0xc256fc!==undefined?_0x4f60dd(0x1e0):_0x68c702!==undefined?_0x4f60dd(0x1db):_0x4f60dd(0x1cf),'original':_0x68c702||'','formatted':_0xc256fc||''});}return _0x9502bf;}[a0_0x636af0(0x1ed)](_0x8f975a,_0x564e44){const _0x51f58e=a0_0x636af0,_0x1b0c1c=_0x8f975a['split']('\x0a'),_0x1bd926=_0x564e44[_0x51f58e(0x1c8)]('\x0a');let _0x187b99=0x0;const _0x4bbac6=Math['max'](_0x1b0c1c['length'],_0x1bd926['length']);for(let _0x51e74c=0x0;_0x51e74c<_0x4bbac6;_0x51e74c++){_0x1b0c1c[_0x51e74c]!==_0x1bd926[_0x51e74c]&&_0x187b99++;}return _0x187b99;}[a0_0x636af0(0x1ce)](){const _0x5095c1=a0_0x636af0;return['.js','.jsx','.mjs',_0x5095c1(0x1cb),_0x5095c1(0x1dd),_0x5095c1(0x1e3),_0x5095c1(0x1d9),'.json5','.css','.scss',_0x5095c1(0x1c7),_0x5095c1(0x1d8),'.vue','.md','.yaml',_0x5095c1(0x1da)];}['isSupported'](_0x3174b8){const _0x5817d8=a0_0x636af0,_0x520b44=a0_0x4d46f6['extname'](_0x3174b8)['toLowerCase']();return this[_0x5817d8(0x1ce)]()['includes'](_0x520b44);}}export default PrettierFormatter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0xe19561=a0_0x2170;(function(_0x300a72,_0x25b516){const _0x54024b=a0_0x2170,_0x3d7791=_0x300a72();while(!![]){try{const _0x3499e4=-parseInt(_0x54024b(0x1db))/0x1+parseInt(_0x54024b(0x1c5))/0x2+-parseInt(_0x54024b(0x1c4))/0x3+-parseInt(_0x54024b(0x1bf))/0x4*(-parseInt(_0x54024b(0x1bb))/0x5)+-parseInt(_0x54024b(0x1e0))/0x6+parseInt(_0x54024b(0x1bd))/0x7+parseInt(_0x54024b(0x1bc))/0x8;if(_0x3499e4===_0x25b516)break;else _0x3d7791['push'](_0x3d7791['shift']());}catch(_0x434942){_0x3d7791['push'](_0x3d7791['shift']());}}}(a0_0x3777,0x237e9));import{spawn}from'child_process';import{STATIC_ANALYSIS}from'../utilities/constants.js';import a0_0x598f72 from'fs/promises';function a0_0x2170(_0x4f5255,_0x41e303){_0x4f5255=_0x4f5255-0x1bb;const _0x3777f7=a0_0x3777();let _0x217073=_0x3777f7[_0x4f5255];if(a0_0x2170['PnIjXj']===undefined){var _0x1ab443=function(_0xb74b6){const _0x193258='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x598f72='',_0x10f2d7='';for(let _0x114844=0x0,_0x1a29ad,_0x1e5702,_0x5adc24=0x0;_0x1e5702=_0xb74b6['charAt'](_0x5adc24++);~_0x1e5702&&(_0x1a29ad=_0x114844%0x4?_0x1a29ad*0x40+_0x1e5702:_0x1e5702,_0x114844++%0x4)?_0x598f72+=String['fromCharCode'](0xff&_0x1a29ad>>(-0x2*_0x114844&0x6)):0x0){_0x1e5702=_0x193258['indexOf'](_0x1e5702);}for(let _0x4add81=0x0,_0x451786=_0x598f72['length'];_0x4add81<_0x451786;_0x4add81++){_0x10f2d7+='%'+('00'+_0x598f72['charCodeAt'](_0x4add81)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x10f2d7);};a0_0x2170['dEbEMP']=_0x1ab443,a0_0x2170['RrHHpw']={},a0_0x2170['PnIjXj']=!![];}const _0x19da50=_0x3777f7[0x0],_0x856bf0=_0x4f5255+_0x19da50,_0x5a02ad=a0_0x2170['RrHHpw'][_0x856bf0];return!_0x5a02ad?(_0x217073=a0_0x2170['dEbEMP'](_0x217073),a0_0x2170['RrHHpw'][_0x856bf0]=_0x217073):_0x217073=_0x5a02ad,_0x217073;}import a0_0x10f2d7 from'path';import a0_0x114844 from'os';class PythonAnalyzer{constructor(_0x1a29ad=null){const _0x10384a=a0_0x2170;this[_0x10384a(0x1d5)]=_0x1a29ad,this['pythonCommand']=null;}async[a0_0xe19561(0x1c0)](_0x1e5702,_0x5adc24,_0x4add81={}){const _0x2471a8=a0_0xe19561;try{const _0x451786=[],_0x198790=await this[_0x2471a8(0x1e3)]();if(!_0x198790)return this[_0x2471a8(0x1d5)]?.[_0x2471a8(0x1cd)](_0x2471a8(0x1d8)),[];const _0xdd38dd=await this[_0x2471a8(0x1e4)](_0x1e5702,_0x5adc24,_0x198790);return _0x451786[_0x2471a8(0x1da)](..._0xdd38dd),this[_0x2471a8(0x1d5)]?.['debug'](_0x2471a8(0x1d6),{'file':_0x1e5702,'totalDiagnostics':_0x451786[_0x2471a8(0x1d4)],'errors':_0x451786['filter'](_0x513535=>_0x513535[_0x2471a8(0x1d7)]===STATIC_ANALYSIS['SEVERITY'][_0x2471a8(0x1d0)])[_0x2471a8(0x1d4)],'warnings':_0x451786[_0x2471a8(0x1d3)](_0x59128e=>_0x59128e['severity']===STATIC_ANALYSIS['SEVERITY'][_0x2471a8(0x1cb)])['length']}),_0x451786;}catch(_0x219a69){return this[_0x2471a8(0x1d5)]?.[_0x2471a8(0x1dc)](_0x2471a8(0x1e5),{'file':_0x1e5702,'error':_0x219a69[_0x2471a8(0x1ca)]}),[];}}async['checkSyntax'](_0x25e4b0,_0x397dd9,_0x35e4c8){const _0x47a876=a0_0xe19561,_0x13d934=[],_0x3df30a=a0_0x114844['tmpdir'](),_0x5db11a=a0_0x10f2d7[_0x47a876(0x1c8)](_0x3df30a,'syntax_check_'+Date['now']()+_0x47a876(0x1be)),_0x4d7596=a0_0x10f2d7['join'](_0x3df30a,'target_'+Date[_0x47a876(0x1e1)]()+_0x47a876(0x1be));try{await a0_0x598f72[_0x47a876(0x1e6)](_0x4d7596,_0x397dd9,'utf-8');const _0x3e58bc='\x0aimport\x20ast\x0aimport\x20sys\x0aimport\x20json\x0a\x0adef\x20check_syntax(filepath):\x0a\x20\x20\x20\x20try:\x0a\x20\x20\x20\x20\x20\x20\x20\x20with\x20open(filepath,\x20\x27r\x27,\x20encoding=\x27utf-8\x27)\x20as\x20f:\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20source\x20=\x20f.read()\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20#\x20Try\x20to\x20parse\x20the\x20file\x0a\x20\x20\x20\x20\x20\x20\x20\x20ast.parse(source,\x20filename=filepath)\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20#\x20If\x20successful,\x20no\x20errors\x0a\x20\x20\x20\x20\x20\x20\x20\x20print(json.dumps({\x22success\x22:\x20True,\x20\x22errors\x22:\x20[]}))\x0a\x0a\x20\x20\x20\x20except\x20SyntaxError\x20as\x20e:\x0a\x20\x20\x20\x20\x20\x20\x20\x20error\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22file\x22:\x20filepath,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22line\x22:\x20e.lineno\x20or\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22column\x22:\x20e.offset\x20or\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22message\x22:\x20str(e.msg),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22text\x22:\x20e.text.strip()\x20if\x20e.text\x20else\x20\x22\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20print(json.dumps({\x22success\x22:\x20False,\x20\x22errors\x22:\x20[error]}))\x0a\x0a\x20\x20\x20\x20except\x20Exception\x20as\x20e:\x0a\x20\x20\x20\x20\x20\x20\x20\x20error\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22file\x22:\x20filepath,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22line\x22:\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22column\x22:\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22message\x22:\x20str(e),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22text\x22:\x20\x22\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20print(json.dumps({\x22success\x22:\x20False,\x20\x22errors\x22:\x20[error]}))\x0a\x0aif\x20__name__\x20==\x20\x22__main__\x22:\x0a\x20\x20\x20\x20if\x20len(sys.argv)\x20>\x201:\x0a\x20\x20\x20\x20\x20\x20\x20\x20check_syntax(sys.argv[1])\x0a\x20\x20\x20\x20else:\x0a\x20\x20\x20\x20\x20\x20\x20\x20print(json.dumps({\x22success\x22:\x20False,\x20\x22errors\x22:\x20[{\x22message\x22:\x20\x22No\x20file\x20specified\x22}]}))\x0a';await a0_0x598f72['writeFile'](_0x5db11a,_0x3e58bc,_0x47a876(0x1cc));const _0xf969f0=await this[_0x47a876(0x1de)](_0x35e4c8,_0x5db11a,[_0x4d7596]);try{const _0xeca5c1=JSON['parse'](_0xf969f0[_0x47a876(0x1d9)]);if(!_0xeca5c1['success']&&_0xeca5c1['errors'])for(const _0x2bf7a0 of _0xeca5c1[_0x47a876(0x1cf)]){_0x13d934[_0x47a876(0x1da)]({'file':_0x25e4b0,'line':_0x2bf7a0['line']||0x1,'column':_0x2bf7a0['column']||0x1,'severity':STATIC_ANALYSIS['SEVERITY'][_0x47a876(0x1d0)],'rule':'SyntaxError','message':_0x2bf7a0['message'],'category':STATIC_ANALYSIS['CATEGORY'][_0x47a876(0x1c9)],'fixable':![],'source':'python-ast','code':_0x2bf7a0['text']||undefined});}}catch(_0x4b5839){this['logger']?.[_0x47a876(0x1cd)]('Failed\x20to\x20parse\x20Python\x20syntax\x20check\x20result',{'error':_0x4b5839['message'],'stdout':_0xf969f0[_0x47a876(0x1d9)]});}}finally{try{await a0_0x598f72['unlink'](_0x5db11a),await a0_0x598f72['unlink'](_0x4d7596);}catch{}}return _0x13d934;}async[a0_0xe19561(0x1e3)](){const _0x2602a7=a0_0xe19561;if(this['pythonCommand'])return this[_0x2602a7(0x1e2)];const _0x32d4cd=[_0x2602a7(0x1c3),'python'];for(const _0x6204ab of _0x32d4cd){try{const _0x5962f1=await this[_0x2602a7(0x1c2)](_0x6204ab,['--version']);if(_0x5962f1['success'])return this['pythonCommand']=_0x6204ab,this[_0x2602a7(0x1d5)]?.[_0x2602a7(0x1d2)]('Found\x20Python\x20command',{'command':_0x6204ab,'version':_0x5962f1[_0x2602a7(0x1d9)][_0x2602a7(0x1dd)]()}),_0x6204ab;}catch{}}return null;}async['runPythonScript'](_0x104f7d,_0x147137,_0x2892b5=[]){return this['runCommand'](_0x104f7d,[_0x147137,..._0x2892b5]);}async['runCommand'](_0x30de50,_0x3c72d5=[],_0x4f7e01={}){return new Promise((_0x367d5c,_0xfc0d)=>{const _0x4da4d9=a0_0x2170,_0x549567=spawn(_0x30de50,_0x3c72d5,{..._0x4f7e01,'shell':!![]});let _0x530a2b='',_0xdc66ab='';_0x549567['stdout']?.['on'](_0x4da4d9(0x1d1),_0x126e74=>{const _0x365a2d=_0x4da4d9;_0x530a2b+=_0x126e74[_0x365a2d(0x1ce)]();}),_0x549567['stderr']?.['on'](_0x4da4d9(0x1d1),_0x1ca740=>{_0xdc66ab+=_0x1ca740['toString']();}),_0x549567['on']('error',_0x2e1853=>{_0xfc0d(_0x2e1853);}),_0x549567['on'](_0x4da4d9(0x1c1),_0x4dc5d4=>{_0x367d5c({'success':_0x4dc5d4===0x0,'code':_0x4dc5d4,'stdout':_0x530a2b,'stderr':_0xdc66ab});}),setTimeout(()=>{const _0x558c45=_0x4da4d9;_0x549567[_0x558c45(0x1c7)](),_0xfc0d(new Error(_0x558c45(0x1c6)));},0x2710);});}[a0_0xe19561(0x1df)](){const _0x4269fc=a0_0xe19561;return[_0x4269fc(0x1be)];}['supportsAutoFix'](){return![];}}export default PythonAnalyzer;function a0_0x3777(){const _0x367458=['mtbmzKrvAfu','mtu5nZy2nfb0y1DpzG','mte3nZiWnhPeweTusa','lNb5','mti4otKYAfHuv0D3','yw5HBhL6zq','y2XVC2u','CNvUq29TBwfUza','ChL0Ag9UmW','ndKWndy3EeThEvfU','mtC1mZeYy0vRvujL','q29TBwfUzcb0Aw1LB3v0','A2LSBa','AM9PBG','u1Lovefy','BwvZC2fNzq','v0fstKLorW','DxrMltG','D2fYBG','Dg9tDhjPBMC','zxjYB3jZ','rvjst1i','zgf0yq','zgvIDwC','zMLSDgvY','BgvUz3rO','Bg9Nz2vY','uhL0Ag9UigfUywX5C2LZignVBxbSzxrLza','C2v2zxjPDhK','uhL0Ag9Uig5VDcbHDMfPBgfIBguSihnRAxbWAw5NigfUywX5C2LZ','C3rKB3v0','ChvZAa','mtGYmdqZBM1ICffH','zxjYB3i','DhjPBq','CNvUuhL0Ag9Uu2nYAxb0','z2v0u3vWCg9YDgvKrxH0zw5ZAw9UCW','mtC0nJKWqKDAD3j4','BM93','ChL0Ag9Uq29TBwfUza','z2v0uhL0Ag9Uq29TBwfUza','y2HLy2TtEw50yxG','uhL0Ag9UigfUywX5C2LZigzHAwXLza','D3jPDgvgAwXL'];a0_0x3777=function(){return _0x367458;};return a0_0x3777();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x34cbb0=a0_0x4c86;(function(_0x2217a0,_0x121a24){const _0xb4323d=a0_0x4c86,_0x13270a=_0x2217a0();while(!![]){try{const _0x3c4efb=-parseInt(_0xb4323d(0x22a))/0x1+-parseInt(_0xb4323d(0x21b))/0x2+-parseInt(_0xb4323d(0x1c8))/0x3*(parseInt(_0xb4323d(0x228))/0x4)+parseInt(_0xb4323d(0x1f5))/0x5+-parseInt(_0xb4323d(0x1f7))/0x6+parseInt(_0xb4323d(0x1ff))/0x7+-parseInt(_0xb4323d(0x1ee))/0x8*(-parseInt(_0xb4323d(0x1dc))/0x9);if(_0x3c4efb===_0x121a24)break;else _0x13270a['push'](_0x13270a['shift']());}catch(_0x22870e){_0x13270a['push'](_0x13270a['shift']());}}}(a0_0x328e,0x94cb2));import{exec}from'child_process';import{promisify}from'util';import a0_0x18cc67 from'path';import a0_0x2dc2dc from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';function a0_0x328e(){const _0x48def3=['y3DL','D2fYBG','CgLWlwf1zgL0ic0TDMvYC2LVBG','C3rKB3v0','ChvZAa','CgfJA2fNzq','ChL0Ag9U','CgfYC2u','mty2otCWohHTDLbgzG','DgL0Bgu','u2vTz3jLCa','y29S','Dg9vChbLCKnHC2u','zgv0zwn0qxzHAwXHyMXLu2nHBM5LCNm','DNvSBMvYywjPBgL0AwvZ','DMLH','CMvTzwrPyxrPB24','u2vTz3jLCcbZy2fUigzHAwXLza','yw5HBhL6zvbYB2PLy3q','BwvZC2fNzq','C3rHCNq','ndbnzKLLyKi','q1Dflq','mZq5ntu3zgLwvw96','BNbTlwf1zgL0','AxnZDwvFC2v2zxjPDhK','AMf2yxnJCMLWDa','BwvZC2fNzxm','CNvUu2vTz3jLCa','CNvUtNbTqxvKAxq','C2vJDxjPDhK','C2vTz3jLCcaTlwnVBMzPzZ1HDxrVic0TANnVBIaI','y29UzMLKzw5Jzq','CgfYC2vqAxbbDwrPDfjLC3vSDhm','DgvZDf9Pza','BwfWrvnmAw50u2v2zxjPDhK','Dg9mB3DLCKnHC2u','zw50CMLLCW','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','AxnZDwvFy3DL','yMfUzgL0','BM9YBwfSAxPLuMvZDwX0CW','v0fstKLorW','zML4x3zLCNnPB25Z','CgfYC2vcyw5KAxrszxn1BhrZ','u0vwrvjjvfK','C2vTz3jLCcaTlxzLCNnPB24','zgvWzw5Kzw5JAwvZ','CgLWlwf1zgL0igrLDgvJDgvK','mtq1mJCYDfjovM93','u2vJDxjPDhKGDNvSBMvYywjPBgL0Eq','CgfYC2vfu0XPBNrszxn1BhrZ','CgLWlwf1zgL0','y3DK','DxjS','Dw5RBM93BG','CMvXDwLYzw1LBNrZlNr4Da','yMfUzgL0ic1MigPZB24GiG','yxzHAwXHyMXLu2nHBM5LCNm','BgLUzq','BwfWugLWqxvKAxrtzxzLCML0Eq','u2vJDxjPDhKGAxnZDwuGzgv0zwn0zwq','CgLWqxvKAxq','B3DHC3a','zxnSAw50lxbSDwDPBI1Zzwn1CML0EsbKzxrLy3rLza','zML4','C2v2zxjPDhK','Bwv0ywrHDge','qMfUzgL0','mta3mwrjruvLrq','BMfTzq','tM8GC2vJDxjPDhKGC2nHBM5LCNmGyxzHAwXHyMXLigzVCIbSyw5NDwfNzq','Bg9Nz2vY','BwfWqMfUzgL0u2v2zxjPDhK','u2vTz3jLCcbZy2fUBMvYigrLDgvJDgvKicHZExn0zw0P','zxjYB3i','ywnJzxnZ','CNvUugLWqxvKAxq','zxnSAw50lxnLy3vYAxr5','CNvUqMfUzgL0','AxnbCNjHEq','AgfZu2nHBM5LCNngB3jmyw5NDwfNzq','CgLWigLUC3rHBgWGC2vTz3jLCcbpuIb1C2uGrg9JA2vYoIbKB2nRzxiGChvSBcbYzxr1CM50B2nVCNaVC2vTz3jLCa','Cgf0Aa','C291CMnL','DNvSBNm','sMf2yvnJCMLWDc9uExbLu2nYAxb0ihnLy3vYAxr5ihj1BgvZ','mtm0ntm2ruf5sM5t','zML4ywjSzq','qMfUzgL0ihnJyw4GzMfPBgvK','C2nHBM5LCG','BNbTigf1zgL0ic0TANnVBG','zgv0zwn0tgfUz3vHz2u','zxH0CMe','mJi4otmXnxL0quDUwq','C2vTz3jLCa','nJe0mJa3nfrruwLMDq','BwvKAxvT','CMvZDwX0CW','CNvUrvnmAw50u2vJDxjPDhK','rvnmAw50ihnLy3vYAxr5ihnJyw4GzMfPBgvK','zxnSAw50lxbSDwDPBI1Zzwn1CML0Eq','u2TPChbPBMCGDgvZDcbMAwXLigzVCIbZzwn1CML0EsbZy2fU','BNbTigf1zgL0igf2ywLSywjSzq','ntG5odKXnfrnthrkrG','qMfUzgL0ihnJyw5UzxiGzgv0zwn0zwq','zgvZy3jPChrPB24','zgLYBMfTzq','AxnZDwvFy29UzMLKzw5Jzq','rMfPBgvKihrVihbHCNnLifnLBwDYzxaGB3v0Chv0','CgfYC2vtzw1NCMvWuMvZDwX0CW','rMfPBgvKihrVihbHCNnLig5WBsbHDwrPDcbVDxrWDxq','AxnZDwvFDgv4Da','zgvIDwC','DhLWzxnJCMLWDa','AM9PBG','CgLWigLUC3rHBgWGyMfUzgL0','q1jjveLdquW','BgLUDfrLEhq','tM8GCgfJA2fNzs5QC29UigzVDw5KlcbZA2LWCgLUzYbUCg0GyxvKAxq','DgvZDa','C2nHBM5LCKnHy2HL','yMfUzgL0ic0TDMvYC2LVBG','CgfJA2fNzs5QC29U'];a0_0x328e=function(){return _0x48def3;};return a0_0x328e();}const execAsync=promisify(exec);function a0_0x4c86(_0x238ed2,_0x4ea9a9){_0x238ed2=_0x238ed2-0x1b1;const _0x328eba=a0_0x328e();let _0x4c86cd=_0x328eba[_0x238ed2];if(a0_0x4c86['lbrQGt']===undefined){var _0x9959f2=function(_0x3076c9){const _0x526e8c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x18cc67='',_0x2dc2dc='';for(let _0x560191=0x0,_0x2c43ab,_0x360222,_0x3e6165=0x0;_0x360222=_0x3076c9['charAt'](_0x3e6165++);~_0x360222&&(_0x2c43ab=_0x560191%0x4?_0x2c43ab*0x40+_0x360222:_0x360222,_0x560191++%0x4)?_0x18cc67+=String['fromCharCode'](0xff&_0x2c43ab>>(-0x2*_0x560191&0x6)):0x0){_0x360222=_0x526e8c['indexOf'](_0x360222);}for(let _0x3893f2=0x0,_0x42a3ae=_0x18cc67['length'];_0x3893f2<_0x42a3ae;_0x3893f2++){_0x2dc2dc+='%'+('00'+_0x18cc67['charCodeAt'](_0x3893f2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2dc2dc);};a0_0x4c86['cAXagX']=_0x9959f2,a0_0x4c86['rOCZUP']={},a0_0x4c86['lbrQGt']=!![];}const _0x345594=_0x328eba[0x0],_0x3f292c=_0x238ed2+_0x345594,_0x212086=a0_0x4c86['rOCZUP'][_0x3f292c];return!_0x212086?(_0x4c86cd=a0_0x4c86['cAXagX'](_0x4c86cd),a0_0x4c86['rOCZUP'][_0x3f292c]=_0x4c86cd):_0x4c86cd=_0x212086,_0x4c86cd;}class SecurityAnalyzer{constructor(_0x560191=null){const _0x348e84=a0_0x4c86;this[_0x348e84(0x1df)]=_0x560191,this[_0x348e84(0x1d1)]=null,this[_0x348e84(0x210)]=new Map(),this['localScannerDir']=a0_0x18cc67[_0x348e84(0x20a)](process['cwd'](),'node_modules','.scanners');}async[a0_0x34cbb0(0x220)](){const _0xa2496=a0_0x34cbb0;if(this[_0xa2496(0x1d1)]!==null)return this['availableScanners'];const _0x2c43ab={'semgrep':![],'bandit':![],'npmAudit':![],'pipAudit':![],'eslintSecurity':![]};try{const _0x360222=a0_0x18cc67[_0xa2496(0x20a)](this['localScannerDir'],'semgrep');try{await a0_0x2dc2dc['access'](_0x360222),_0x2c43ab[_0xa2496(0x1f6)]=!![],this['logger']?.[_0xa2496(0x208)]('Semgrep\x20scanner\x20detected\x20(local)');}catch{await execAsync(_0xa2496(0x1c5),{'timeout':0x1388}),_0x2c43ab['semgrep']=!![],this['logger']?.['debug'](_0xa2496(0x1e1));}}catch(_0x3e6165){this[_0xa2496(0x1df)]?.[_0xa2496(0x208)]('Semgrep\x20not\x20available',{'error':_0x3e6165[_0xa2496(0x226)]});}try{await execAsync(_0xa2496(0x211),{'timeout':0x1388}),_0x2c43ab[_0xa2496(0x1bf)]=!![],this['logger']?.['debug'](_0xa2496(0x200));}catch(_0x3893f2){this[_0xa2496(0x1df)]?.['debug']('Bandit\x20not\x20available',{'error':_0x3893f2['message']});}try{await execAsync('npm\x20--version',{'timeout':0x1388}),_0x2c43ab['npmAudit']=!![],this['logger']?.['debug'](_0xa2496(0x1fe));}catch(_0x42a3ae){this[_0xa2496(0x1df)]?.['debug']('npm\x20not\x20available',{'error':_0x42a3ae['message']});}try{await execAsync(_0xa2496(0x215),{'timeout':0x1388}),_0x2c43ab['pipAudit']=!![],this['logger']?.['debug'](_0xa2496(0x1c7));}catch(_0x4236f0){this['logger']?.['debug']('pip-audit\x20not\x20available',{'error':_0x4236f0[_0xa2496(0x226)]});}try{const _0x2c10c8=await execAsync('npm\x20list\x20eslint-plugin-security\x20--depth=0\x20--json',{'timeout':0x1388,'cwd':process[_0xa2496(0x1cc)]()}),_0x31d8fb=JSON[_0xa2496(0x21a)](_0x2c10c8['stdout']);_0x31d8fb['dependencies']&&_0x31d8fb[_0xa2496(0x1c6)][_0xa2496(0x1fc)]&&(_0x2c43ab['eslintSecurity']=!![],this['logger']?.[_0xa2496(0x208)](_0xa2496(0x1d7)));}catch(_0x1762f2){this[_0xa2496(0x1df)]?.['debug']('eslint-plugin-security\x20not\x20available',{'error':_0x1762f2['message']});}return this['availableScanners']=_0x2c43ab,_0x2c43ab;}async['analyze'](_0x13176b,_0x192520,_0x398947={}){const _0x350cf5=a0_0x34cbb0,_0x1536fd=[],_0x5e2ec8=await this[_0x350cf5(0x220)](),_0xea5f61=this[_0x350cf5(0x1f3)](_0x13176b);if(_0x398947['skipTestFiles']!==![]&&this['isTestFile'](_0x13176b))return this['logger']?.[_0x350cf5(0x208)](_0x350cf5(0x1fd),{'filePath':_0x13176b}),[];if(_0xea5f61==='javascript'||_0xea5f61==='typescript'){if(_0x5e2ec8['semgrep']){const _0x2acc0f=await this[_0x350cf5(0x1b3)](_0x13176b,[_0xea5f61],_0x398947);_0x1536fd['push'](..._0x2acc0f);}if(_0x5e2ec8['eslintSecurity']){const _0x39ff40=await this['runESLintSecurity'](_0x13176b,_0x192520,_0x398947);_0x1536fd['push'](..._0x39ff40);}}if(_0xea5f61==='python'){if(_0x5e2ec8[_0x350cf5(0x1bf)]){const _0x4179a8=await this[_0x350cf5(0x1e6)](_0x13176b,_0x398947);_0x1536fd['push'](..._0x4179a8);}if(_0x5e2ec8['semgrep']){const _0x274c86=await this['runSemgrep'](_0x13176b,[_0xea5f61],_0x398947);_0x1536fd['push'](..._0x274c86);}}return _0x1536fd['length']===0x0&&!this['hasScannersForLanguage'](_0x5e2ec8,_0xea5f61)&&this[_0x350cf5(0x1df)]?.[_0x350cf5(0x214)](_0x350cf5(0x1de),{'language':_0xea5f61,'filePath':_0x13176b}),this[_0x350cf5(0x1c0)](_0x1536fd);}async[a0_0x34cbb0(0x225)](_0x10f851,_0x3f806b,_0x28e29f={}){const _0x4873bd=a0_0x34cbb0,_0x1176f0=[],_0x3c7270=await this['detectAvailableScanners']();if(_0x3f806b==='javascript'||_0x3f806b===_0x4873bd(0x209)){if(_0x3c7270['npmAudit']){const _0x45dc06=await this[_0x4873bd(0x1b4)](_0x10f851,_0x28e29f);_0x1176f0['push'](..._0x45dc06);}}if(_0x3f806b===_0x4873bd(0x219)){if(_0x3c7270[_0x4873bd(0x1d5)]){const _0x272071=await this[_0x4873bd(0x1e4)](_0x10f851,_0x28e29f);_0x1176f0['push'](..._0x272071);}}return this['normalizeResults'](_0x1176f0);}async['runSemgrep'](_0x4668c4,_0x5367b6,_0x2fedb2={}){const _0x2ab0a4=a0_0x34cbb0;try{const _0x35c0da=a0_0x18cc67[_0x2ab0a4(0x202)](_0x4668c4),_0x355744=await execAsync(_0x2ab0a4(0x1b6)+_0x4668c4+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530,'cwd':_0x35c0da}),_0x6c784e=JSON['parse'](_0x355744[_0x2ab0a4(0x216)]);return this[_0x2ab0a4(0x205)](_0x6c784e);}catch(_0x22c17c){if(_0x22c17c[_0x2ab0a4(0x216)])try{const _0x54474e=JSON['parse'](_0x22c17c[_0x2ab0a4(0x216)]);return this['parseSemgrepResults'](_0x54474e);}catch(_0x177985){this[_0x2ab0a4(0x1df)]?.['error'](_0x2ab0a4(0x204),{'error':_0x177985['message'],'stdout':_0x22c17c['stdout']});}return this[_0x2ab0a4(0x1df)]?.[_0x2ab0a4(0x1e2)](_0x2ab0a4(0x224),{'error':_0x22c17c[_0x2ab0a4(0x226)]}),[];}}[a0_0x34cbb0(0x205)](_0x335e89){const _0x319ef8=a0_0x34cbb0,_0x51e0fa=[];if(_0x335e89['results']&&Array[_0x319ef8(0x1e7)](_0x335e89[_0x319ef8(0x1f9)]))for(const _0x24c657 of _0x335e89[_0x319ef8(0x1f9)]){_0x51e0fa['push']({'file':_0x24c657[_0x319ef8(0x1ea)],'line':_0x24c657[_0x319ef8(0x227)]?.['line']||0x1,'column':_0x24c657[_0x319ef8(0x227)]?.[_0x319ef8(0x21e)]||0x1,'severity':this['mapSemgrepSeverity'](_0x24c657[_0x319ef8(0x1f4)]?.[_0x319ef8(0x1d9)]),'rule':_0x24c657['check_id'],'message':_0x24c657['extra']?.['message']||_0x24c657[_0x319ef8(0x1f4)]?.['lines']||'Security\x20issue\x20detected','category':'security','scanner':_0x319ef8(0x1f6),'cwe':_0x24c657['extra']?.['metadata']?.[_0x319ef8(0x213)],'owasp':_0x24c657[_0x319ef8(0x1f4)]?.['metadata']?.[_0x319ef8(0x1d6)],'confidence':_0x24c657[_0x319ef8(0x1f4)]?.['metadata']?.[_0x319ef8(0x1b7)],'references':_0x24c657['extra']?.[_0x319ef8(0x1da)]?.['references']});}return _0x51e0fa;}async[a0_0x34cbb0(0x1e6)](_0x4f756d,_0x5a8e1f={}){const _0x4c7223=a0_0x34cbb0;try{const _0x4af802=await execAsync(_0x4c7223(0x1d0)+_0x4f756d+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x508408=JSON['parse'](_0x4af802['stdout']);return this[_0x4c7223(0x1c3)](_0x508408);}catch(_0x22f453){if(_0x22f453[_0x4c7223(0x216)])try{const _0x55d27e=JSON[_0x4c7223(0x21a)](_0x22f453['stdout']);return this['parseBanditResults'](_0x55d27e);}catch(_0x4bb8f9){this[_0x4c7223(0x1df)]?.['error']('Failed\x20to\x20parse\x20Bandit\x20output',{'error':_0x4bb8f9[_0x4c7223(0x226)]});}return this['logger']?.['error'](_0x4c7223(0x1f0),{'error':_0x22f453[_0x4c7223(0x226)]}),[];}}[a0_0x34cbb0(0x1c3)](_0x2e4087){const _0x5b3750=a0_0x34cbb0,_0xa1d89=[];if(_0x2e4087[_0x5b3750(0x1f9)]&&Array[_0x5b3750(0x1e7)](_0x2e4087[_0x5b3750(0x1f9)]))for(const _0xc833de of _0x2e4087['results']){_0xa1d89['push']({'file':_0xc833de['filename'],'line':_0xc833de['line_number']||0x1,'column':_0xc833de['col_offset']||0x1,'severity':this['mapBanditSeverity'](_0xc833de[_0x5b3750(0x22c)]),'rule':_0xc833de[_0x5b3750(0x1b9)],'message':_0xc833de[_0x5b3750(0x207)],'category':_0x5b3750(0x1b5),'scanner':'bandit','cwe':_0xc833de[_0x5b3750(0x1be)]?.['id']?_0x5b3750(0x229)+_0xc833de['issue_cwe']['id']:null,'confidence':_0xc833de[_0x5b3750(0x203)],'moreInfo':_0xc833de['more_info']});}return _0xa1d89;}async[a0_0x34cbb0(0x1fa)](_0x1d45ab,_0x5a396a,_0x456677={}){const _0x27c57c=a0_0x34cbb0;try{const {ESLint:_0x2d479f}=await import('eslint'),_0x15e3fe=new _0x2d479f({'overrideConfig':{'plugins':['security'],'extends':['plugin:security/recommended'],'parserOptions':{'ecmaVersion':'latest','sourceType':'module'}},'useEslintrc':![]}),_0x2e1b0f=await _0x15e3fe[_0x27c57c(0x20d)](_0x5a396a,{'filePath':_0x1d45ab});return this[_0x27c57c(0x1ca)](_0x2e1b0f,_0x1d45ab);}catch(_0x338b2a){return this[_0x27c57c(0x1df)]?.['error'](_0x27c57c(0x1fb),{'error':_0x338b2a[_0x27c57c(0x226)],'filePath':_0x1d45ab}),[];}}[a0_0x34cbb0(0x1ca)](_0x28708f,_0x394db2){const _0x1e89d9=a0_0x34cbb0,_0x137f8e=[];for(const _0x3344c4 of _0x28708f){if(_0x3344c4[_0x1e89d9(0x1b2)]&&Array[_0x1e89d9(0x1e7)](_0x3344c4[_0x1e89d9(0x1b2)]))for(const _0x2f2681 of _0x3344c4[_0x1e89d9(0x1b2)]){_0x2f2681['ruleId']&&_0x2f2681['ruleId']['startsWith']('security/')&&_0x137f8e['push']({'file':_0x394db2,'line':_0x2f2681['line']||0x1,'column':_0x2f2681['column']||0x1,'severity':this[_0x1e89d9(0x1ba)](_0x2f2681[_0x1e89d9(0x1d9)]),'rule':_0x2f2681['ruleId'],'message':_0x2f2681['message'],'category':'security','scanner':_0x1e89d9(0x1e5),'fixable':_0x2f2681[_0x1e89d9(0x1d8)]!==undefined});}}return _0x137f8e;}async[a0_0x34cbb0(0x1b4)](_0x20f08c,_0x4457ca={}){const _0x25abeb=a0_0x34cbb0;try{const _0x4cf6ac=a0_0x18cc67['join'](_0x20f08c,_0x25abeb(0x212));try{await a0_0x2dc2dc[_0x25abeb(0x1e3)](_0x4cf6ac);}catch{return this[_0x25abeb(0x1df)]?.['debug'](_0x25abeb(0x20e)),[];}const _0x2508ad=await execAsync(_0x25abeb(0x1f2),{'cwd':_0x20f08c,'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x5384bc=JSON['parse'](_0x2508ad['stdout']);return this['parseNpmAuditResults'](_0x5384bc);}catch(_0x33b992){if(_0x33b992['stdout'])try{const _0x5434a2=JSON['parse'](_0x33b992['stdout']);return this['parseNpmAuditResults'](_0x5434a2);}catch(_0x35798d){this[_0x25abeb(0x1df)]?.[_0x25abeb(0x1e2)](_0x25abeb(0x206),{'error':_0x35798d['message']});}return[];}}['parseNpmAuditResults'](_0x23e32e){const _0x17d303=a0_0x34cbb0,_0x47e85e=[];if(_0x23e32e[_0x17d303(0x221)])for(const [_0x51e213,_0x26d6f2]of Object[_0x17d303(0x1bc)](_0x23e32e[_0x17d303(0x221)])){_0x47e85e[_0x17d303(0x217)]({'file':_0x17d303(0x212),'line':0x1,'column':0x1,'severity':this['mapNpmSeverity'](_0x26d6f2['severity']),'rule':'npm-'+(_0x26d6f2[_0x17d303(0x222)][0x0]?.[_0x17d303(0x1eb)]||'advisory'),'message':_0x51e213+':\x20'+(_0x26d6f2['via'][0x0]?.[_0x17d303(0x21c)]||'Security\x20vulnerability'),'category':_0x17d303(0x1b5),'scanner':_0x17d303(0x22b),'package':_0x51e213,'vulnerableVersions':_0x26d6f2['range'],'patchedVersions':_0x26d6f2['fixAvailable']?'Available':'None','cve':_0x26d6f2['via'][0x0]?.['cve'],'cvss':_0x26d6f2[_0x17d303(0x222)][0x0]?.['cvss'],'references':_0x26d6f2['via'][0x0]?.[_0x17d303(0x1cd)]?[_0x26d6f2[_0x17d303(0x222)][0x0]['url']]:[]});}return _0x47e85e;}async[a0_0x34cbb0(0x1e4)](_0x302807,_0x21e8a0={}){const _0x301cd1=a0_0x34cbb0;try{const requirementsPath=a0_0x18cc67[_0x301cd1(0x20a)](_0x302807,_0x301cd1(0x1cf));try{await a0_0x2dc2dc['access'](requirementsPath);}catch{return this[_0x301cd1(0x1df)]?.[_0x301cd1(0x208)]('No\x20requirements.txt\x20found,\x20skipping\x20pip-audit'),[];}const _0x3aa648=await execAsync('pip-audit\x20--format\x20json',{'cwd':_0x302807,'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x4b2078=JSON[_0x301cd1(0x21a)](_0x3aa648['stdout']);return this['parsePipAuditResults'](_0x4b2078);}catch(_0x106ec5){if(_0x106ec5[_0x301cd1(0x216)])try{const _0x1fcb2e=JSON[_0x301cd1(0x21a)](_0x106ec5['stdout']);return this['parsePipAuditResults'](_0x1fcb2e);}catch(_0x4f0af1){this[_0x301cd1(0x1df)]?.['error']('Failed\x20to\x20parse\x20pip-audit\x20output',{'error':_0x4f0af1[_0x301cd1(0x226)]});}return[];}}[a0_0x34cbb0(0x1b8)](_0xa8d9fe){const _0x5c1b64=a0_0x34cbb0,_0x354367=[];if(_0xa8d9fe[_0x5c1b64(0x1c6)]&&Array['isArray'](_0xa8d9fe[_0x5c1b64(0x1c6)]))for(const _0x55a4c7 of _0xa8d9fe['dependencies']){if(_0x55a4c7['vulns']&&Array[_0x5c1b64(0x1e7)](_0x55a4c7[_0x5c1b64(0x1ec)]))for(const _0x1bd0e9 of _0x55a4c7[_0x5c1b64(0x1ec)]){_0x354367[_0x5c1b64(0x217)]({'file':_0x5c1b64(0x1cf),'line':0x1,'column':0x1,'severity':this['mapPipAuditSeverity'](_0x1bd0e9[_0x5c1b64(0x1d9)]),'rule':_0x1bd0e9['id'],'message':_0x55a4c7[_0x5c1b64(0x1dd)]+':\x20'+(_0x1bd0e9[_0x5c1b64(0x201)]||_0x5c1b64(0x1c9)),'category':'security','scanner':'pip-audit','package':_0x55a4c7['name'],'vulnerableVersion':_0x55a4c7['version'],'fixedVersions':_0x1bd0e9[_0x5c1b64(0x1c2)],'references':_0x1bd0e9['aliases']||[]});}}return _0x354367;}[a0_0x34cbb0(0x1f3)](_0x4d1604){const _0x3f5e62=a0_0x34cbb0,_0x581ae0=a0_0x18cc67['extname'](_0x4d1604)[_0x3f5e62(0x1bb)](),_0x405414={'.js':_0x3f5e62(0x1b1),'.jsx':_0x3f5e62(0x1b1),'.mjs':'javascript','.cjs':_0x3f5e62(0x1b1),'.ts':_0x3f5e62(0x209),'.tsx':_0x3f5e62(0x209),'.py':_0x3f5e62(0x219)};return _0x405414[_0x581ae0]||null;}['isTestFile'](_0x1768bf){const _0x345761=a0_0x34cbb0,_0x47df78=[/\.test\./,/\.spec\./,/__tests__\//,/\/tests?\//,/\.test$/,/\.spec$/];return _0x47df78['some'](_0x3139c8=>_0x3139c8[_0x345761(0x20f)](_0x1768bf));}[a0_0x34cbb0(0x1e8)](_0x35cce5,_0x67faa5){const _0x21fac3=a0_0x34cbb0;if(_0x67faa5===_0x21fac3(0x1b1)||_0x67faa5==='typescript')return _0x35cce5['semgrep']||_0x35cce5['eslintSecurity'];if(_0x67faa5===_0x21fac3(0x219))return _0x35cce5[_0x21fac3(0x1bf)]||_0x35cce5['semgrep'];return![];}[a0_0x34cbb0(0x1c0)](_0x44b3b0){const _0x5782ea=a0_0x34cbb0;return _0x44b3b0['map'](_0x1f4984=>({'file':_0x1f4984['file'],'line':_0x1f4984[_0x5782ea(0x1d2)]||0x1,'column':_0x1f4984['column']||0x1,'severity':_0x1f4984['severity']||STATIC_ANALYSIS['SEVERITY'][_0x5782ea(0x1c1)],'rule':_0x1f4984['rule']||_0x5782ea(0x1ce),'message':_0x1f4984[_0x5782ea(0x226)]||_0x5782ea(0x1d4),'category':'security','scanner':_0x1f4984[_0x5782ea(0x1f1)],'cwe':_0x1f4984[_0x5782ea(0x213)]||null,'owasp':_0x1f4984['owasp']||null,'confidence':_0x1f4984['confidence']||null,'fixable':_0x1f4984[_0x5782ea(0x1ef)]||![],'remediation':_0x1f4984[_0x5782ea(0x223)]||_0x1f4984['moreInfo']||null,'references':_0x1f4984['references']||[],'package':_0x1f4984[_0x5782ea(0x218)]||null}));}['mapSemgrepSeverity'](_0x29a071){const _0xb3029c=a0_0x34cbb0,_0x14295c={'ERROR':STATIC_ANALYSIS[_0xb3029c(0x1c4)][_0xb3029c(0x20c)],'WARNING':STATIC_ANALYSIS[_0xb3029c(0x1c4)]['ERROR'],'INFO':STATIC_ANALYSIS[_0xb3029c(0x1c4)]['WARNING']};return _0x14295c[_0x29a071?.[_0xb3029c(0x21f)]()]||STATIC_ANALYSIS[_0xb3029c(0x1c4)][_0xb3029c(0x1c1)];}[a0_0x34cbb0(0x1e0)](_0x5c7095){const _0x29420b=a0_0x34cbb0,_0x59aecf={'HIGH':STATIC_ANALYSIS['SEVERITY'][_0x29420b(0x20c)],'MEDIUM':STATIC_ANALYSIS[_0x29420b(0x1c4)]['ERROR'],'LOW':STATIC_ANALYSIS[_0x29420b(0x1c4)][_0x29420b(0x1c1)]};return _0x59aecf[_0x5c7095?.['toUpperCase']()]||STATIC_ANALYSIS['SEVERITY']['WARNING'];}[a0_0x34cbb0(0x1ba)](_0x309e3f){const _0x558943=a0_0x34cbb0;return _0x309e3f===0x2?STATIC_ANALYSIS[_0x558943(0x1c4)]['ERROR']:STATIC_ANALYSIS['SEVERITY']['WARNING'];}['mapNpmSeverity'](_0x17caa3){const _0x56519c=a0_0x34cbb0,_0x4a3dda={'critical':STATIC_ANALYSIS[_0x56519c(0x1c4)][_0x56519c(0x20c)],'high':STATIC_ANALYSIS[_0x56519c(0x1c4)][_0x56519c(0x20c)],'moderate':STATIC_ANALYSIS['SEVERITY']['ERROR'],'low':STATIC_ANALYSIS[_0x56519c(0x1c4)][_0x56519c(0x1c1)],'info':STATIC_ANALYSIS[_0x56519c(0x1c4)]['INFO']};return _0x4a3dda[_0x17caa3?.['toLowerCase']()]||STATIC_ANALYSIS['SEVERITY'][_0x56519c(0x1c1)];}[a0_0x34cbb0(0x1d3)](_0x3ebb9f){const _0x2bc320=a0_0x34cbb0;if(!_0x3ebb9f)return STATIC_ANALYSIS[_0x2bc320(0x1c4)]['ERROR'];const _0x20ccfa={'critical':STATIC_ANALYSIS['SEVERITY'][_0x2bc320(0x20c)],'high':STATIC_ANALYSIS[_0x2bc320(0x1c4)][_0x2bc320(0x20c)],'medium':STATIC_ANALYSIS[_0x2bc320(0x1c4)]['ERROR'],'low':STATIC_ANALYSIS['SEVERITY'][_0x2bc320(0x1c1)]};return _0x20ccfa[_0x3ebb9f?.[_0x2bc320(0x1bb)]()]||STATIC_ANALYSIS[_0x2bc320(0x1c4)]['ERROR'];}async['getScannerStatus'](){const _0x328e04=a0_0x34cbb0,_0x5c0fcd=await this[_0x328e04(0x220)]();return{'scanners':_0x5c0fcd,'recommendations':this[_0x328e04(0x1bd)](_0x5c0fcd)};}[a0_0x34cbb0(0x1bd)](_0x50fdaf){const _0x570a13=a0_0x34cbb0,_0xe4cc2=[];return!_0x50fdaf[_0x570a13(0x1f6)]&&_0xe4cc2[_0x570a13(0x217)]({'scanner':_0x570a13(0x21d),'reason':'Multi-language\x20SAST\x20with\x20extensive\x20security\x20rules','install':_0x570a13(0x1e9),'priority':'high'}),!_0x50fdaf['bandit']&&_0xe4cc2[_0x570a13(0x217)]({'scanner':_0x570a13(0x1db),'reason':'Python\x20security\x20scanner','install':_0x570a13(0x20b),'priority':'medium'}),!_0x50fdaf['eslintSecurity']&&_0xe4cc2[_0x570a13(0x217)]({'scanner':_0x570a13(0x1fc),'reason':_0x570a13(0x1ed),'install':'npm\x20install\x20--save-dev\x20eslint-plugin-security','priority':_0x570a13(0x1f8)}),!_0x50fdaf['pipAudit']&&_0xe4cc2[_0x570a13(0x217)]({'scanner':_0x570a13(0x1cb),'reason':'Python\x20dependency\x20vulnerability\x20scanner','install':'pip\x20install\x20pip-audit','priority':'low'}),_0xe4cc2;}}export default SecurityAnalyzer;
|
|
1
|
+
function a0_0xab2e(_0x511aed,_0x2081fb){_0x511aed=_0x511aed-0x16f;const _0x5aa9b8=a0_0x5aa9();let _0xab2ee9=_0x5aa9b8[_0x511aed];if(a0_0xab2e['ABxICz']===undefined){var _0x57d5da=function(_0x40e4a4){const _0x446922='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x41c490='',_0xf94c0d='';for(let _0x29d298=0x0,_0x82f2d4,_0x3ec4ec,_0x22654b=0x0;_0x3ec4ec=_0x40e4a4['charAt'](_0x22654b++);~_0x3ec4ec&&(_0x82f2d4=_0x29d298%0x4?_0x82f2d4*0x40+_0x3ec4ec:_0x3ec4ec,_0x29d298++%0x4)?_0x41c490+=String['fromCharCode'](0xff&_0x82f2d4>>(-0x2*_0x29d298&0x6)):0x0){_0x3ec4ec=_0x446922['indexOf'](_0x3ec4ec);}for(let _0x43558f=0x0,_0x118ef4=_0x41c490['length'];_0x43558f<_0x118ef4;_0x43558f++){_0xf94c0d+='%'+('00'+_0x41c490['charCodeAt'](_0x43558f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xf94c0d);};a0_0xab2e['wbokYv']=_0x57d5da,a0_0xab2e['zEkeaT']={},a0_0xab2e['ABxICz']=!![];}const _0x46b096=_0x5aa9b8[0x0],_0x125736=_0x511aed+_0x46b096,_0x1c6056=a0_0xab2e['zEkeaT'][_0x125736];return!_0x1c6056?(_0xab2ee9=a0_0xab2e['wbokYv'](_0xab2ee9),a0_0xab2e['zEkeaT'][_0x125736]=_0xab2ee9):_0xab2ee9=_0x1c6056,_0xab2ee9;}const a0_0x3af026=a0_0xab2e;function a0_0x5aa9(){const _0x20ea01=['y29S','zgvWzw5Kzw5JAwvZ','mtu4n2zgvLvcAa','yxzHAwXHyMXLu2nHBM5LCNm','mtGWmtG3ntzKCeXiBMW','ywXPyxnLCW','Dw5RBM93BG','C2vJDxjPDhKV','BNbTigf1zgL0igf2ywLSywjSzq','C2vTz3jLCa','zxH0CMe','C2vJDxjPDhK','BM9Kzv9TB2r1BgvZ','CNvUqMfUzgL0','CMvZDwX0CW','ChvZAa','DNvSBNm','C3rKB3v0','mtq3otuWmuv4BxjhvW','DMLH','CMvMzxjLBMnLCW','BgLUzq','BM9YBwfSAxPLuMvZDwX0CW','zxjYB3i','otiYnhjpBfLJuG','zgv0zwn0tgfUz3vHz2u','lNnJyw5UzxjZ','CgLWigLUC3rHBgWGC2vTz3jLCcbpuIb1C2uGrg9JA2vYoIbKB2nRzxiGChvSBcbYzxr1CM50B2nVCNaVC2vTz3jLCa','C2v2zxjPDhK','rvjst1i','yMfUzgL0ic1MigPZB24GiG','DMvYC2LVBG','BwvZC2fNzq','y29Sx29MzNnLDa','u2TPChbPBMCGDgvZDcbMAwXLigzVCIbZzwn1CML0EsbZy2fU','CgfYC2u','v0fstKLorW','CgfYC2vcyw5KAxrszxn1BhrZ','u2vTz3jLCa','tM8GCgfJA2fNzs5QC29UigzVDw5KlcbZA2LWCgLUzYbUCg0GyxvKAxq','y29SDw1U','CNvSzuLK','AxnZDwvFy29UzMLKzw5Jzq','BgLUzxm','Bg9Nz2vY','CgLWqxvKAxq','z2v0sw5ZDgfSBfjLy29TBwvUzgf0Aw9UCW','u2vTz3jLCcbZy2fUBMvYigrLDgvJDgvKicHZExn0zw0P','CgX1z2LUoNnLy3vYAxr5l3jLy29TBwvUzgvK','AxnZDwvFy3DL','nMr6D3HwyW','y29UzMLKzw5Jzq','BwfWtNbTu2v2zxjPDhK','mJrcy2vtEfa','CgfYC2voCg1bDwrPDfjLC3vSDhm','zgLYBMfTzq','y3DK','ntiYogHIsgLjEG','tM9Uzq','CNvUu2vTz3jLCa','C3rHCNq','y2HLy2TFAwq','CNvUrvnmAw50u2vJDxjPDhK','CNvUtNbTqxvKAxq','BNbTqxvKAxq','CgLWlwf1zgL0','zgv0zwn0qxzHAwXHyMXLu2nHBM5LCNm','C29Tzq','CMvXDwLYzw1LBNrZlNr4Da','odKXmJCZoxfszKHUyG','B3DHC3a','Dg9mB3DLCKnHC2u','u0vwrvjjvfK','CgLWlwf1zgL0ic0TzM9YBwf0igPZB24','BMfTzq','BwfWrvnmAw50u2v2zxjPDhK','mtu4q3bvDMXc','sMf2yvnJCMLWDc9uExbLu2nYAxb0ihnLy3vYAxr5ihj1BgvZ','ndi2ntu5s1LIBg9I','Bg9JywXty2fUBMvYrgLY','u2vTz3jLCcbZy2fUigzHAwXLza','CgLWlwf1zgL0igrLDgvJDgvK','CgfJA2fNzq','DNvSBMvYywjPBgL0AwvZ','q1Dflq','zxnSAw50lxbSDwDPBI1Zzwn1CML0Eq','Dg9vChbLCKnHC2u','C2TPCfrLC3rgAwXLCW','Bw9YzuLUzM8','yw5HBhL6zq','u2vJDxjPDhKGAxnZDwuGzgv0zwn0zwq','AxnZDwvFDgv4Da','mJCXoti4nvngDvnHvG','AMf2yxnJCMLWDa','Axnuzxn0rMLSzq','zgvIDwC','BNbTlwf1zgL0','CgfYC2vfu0XPBNrszxn1BhrZ','y3DL','mJbozLD6uNe','BwvZC2fNzxm','zxnSAw50lxnLy3vYAxr5','zxnSAw50lxbSDwDPBI1Zzwn1CML0EsbKzxrLy3rLza','DhLWzxnJCMLWDa','uhL0Ag9UihnLy3vYAxr5ihnJyw5Uzxi','zxnSAw50u2vJDxjPDhK','C2nHBM5LCKnHy2HL','CgfYC2vtzw1NCMvWuMvZDwX0CW','CgfJA2fNzs5QC29U','Bwv0ywrHDge','BwfWugLWqxvKAxrtzxzLCML0Eq','rMfPBgvKihrVihbHCNnLig5WBsbHDwrPDcbVDxrWDxq','Cgf0Aa','ChL0Ag9U','DxjS','zMLSzw5HBwu','q1jjveLdquW','CgLWlwf1zgL0ig5VDcbHDMfPBgfIBgu'];a0_0x5aa9=function(){return _0x20ea01;};return a0_0x5aa9();}(function(_0x44cf42,_0x25ec69){const _0x353ea5=a0_0xab2e,_0x1c646c=_0x44cf42();while(!![]){try{const _0x36b7a7=-parseInt(_0x353ea5(0x1ac))/0x1*(parseInt(_0x353ea5(0x1e0))/0x2)+parseInt(_0x353ea5(0x196))/0x3*(-parseInt(_0x353ea5(0x1cd))/0x4)+parseInt(_0x353ea5(0x17a))/0x5*(-parseInt(_0x353ea5(0x1c6))/0x6)+parseInt(_0x353ea5(0x1e2))/0x7*(-parseInt(_0x353ea5(0x1c9))/0x8)+parseInt(_0x353ea5(0x1a6))/0x9*(parseInt(_0x353ea5(0x181))/0xa)+parseInt(_0x353ea5(0x1d9))/0xb+parseInt(_0x353ea5(0x198))/0xc;if(_0x36b7a7===_0x25ec69)break;else _0x1c646c['push'](_0x1c646c['shift']());}catch(_0x3d0531){_0x1c646c['push'](_0x1c646c['shift']());}}}(a0_0x5aa9,0x788ff));import{exec}from'child_process';import{promisify}from'util';import a0_0x41c490 from'path';import a0_0xf94c0d from'fs/promises';import{STATIC_ANALYSIS}from'../utilities/constants.js';const execAsync=promisify(exec);class SecurityAnalyzer{constructor(_0x29d298=null){const _0x45976a=a0_0xab2e;this['logger']=_0x29d298,this['availableScanners']=null,this[_0x45976a(0x188)]=new Map(),this['localScannerDir']=a0_0x41c490['join'](process[_0x45976a(0x1cc)](),_0x45976a(0x1a0),_0x45976a(0x1ae));}async[a0_0x3af026(0x1d6)](){const _0x3191b3=a0_0x3af026;if(this[_0x3191b3(0x197)]!==null)return this[_0x3191b3(0x197)];const _0x82f2d4={'semgrep':![],'bandit':![],'npmAudit':![],'pipAudit':![],'eslintSecurity':![]};try{const _0x3ec4ec=a0_0x41c490['join'](this[_0x3191b3(0x1e3)],_0x3191b3(0x19d));try{await a0_0xf94c0d['access'](_0x3ec4ec),_0x82f2d4['semgrep']=!![],this['logger']?.[_0x3191b3(0x17d)]('Semgrep\x20scanner\x20detected\x20(local)');}catch{await execAsync('semgrep\x20--version',{'timeout':0x1388}),_0x82f2d4[_0x3191b3(0x19d)]=!![],this[_0x3191b3(0x1c0)]?.[_0x3191b3(0x17d)](_0x3191b3(0x1c3));}}catch(_0x22654b){this['logger']?.['debug']('Semgrep\x20not\x20available',{'error':_0x22654b[_0x3191b3(0x1b4)]});}try{await execAsync('bandit\x20--version',{'timeout':0x1388}),_0x82f2d4['bandit']=!![],this['logger']?.['debug']('Bandit\x20scanner\x20detected');}catch(_0x43558f){this['logger']?.[_0x3191b3(0x17d)]('Bandit\x20not\x20available',{'error':_0x43558f['message']});}try{await execAsync('npm\x20--version',{'timeout':0x1388}),_0x82f2d4[_0x3191b3(0x1d4)]=!![],this[_0x3191b3(0x1c0)]?.['debug'](_0x3191b3(0x19c));}catch(_0x118ef4){this['logger']?.['debug']('npm\x20not\x20available',{'error':_0x118ef4[_0x3191b3(0x1b4)]});}try{await execAsync('pip-audit\x20--version',{'timeout':0x1388}),_0x82f2d4['pipAudit']=!![],this['logger']?.[_0x3191b3(0x17d)](_0x3191b3(0x16f));}catch(_0xaecce4){this[_0x3191b3(0x1c0)]?.[_0x3191b3(0x17d)](_0x3191b3(0x193),{'error':_0xaecce4['message']});}try{const _0x7ddaeb=await execAsync('npm\x20list\x20eslint-plugin-security\x20--depth=0\x20--json',{'timeout':0x1388,'cwd':process['cwd']()}),_0xadcd9=JSON[_0x3191b3(0x1b7)](_0x7ddaeb[_0x3191b3(0x1a5)]);_0xadcd9[_0x3191b3(0x195)]&&_0xadcd9['dependencies'][_0x3191b3(0x173)]&&(_0x82f2d4['eslintSecurity']=!![],this[_0x3191b3(0x1c0)]?.[_0x3191b3(0x17d)](_0x3191b3(0x184)));}catch(_0x5e46bb){this[_0x3191b3(0x1c0)]?.['debug']('eslint-plugin-security\x20not\x20available',{'error':_0x5e46bb[_0x3191b3(0x1b4)]});}return this['availableScanners']=_0x82f2d4,_0x82f2d4;}async[a0_0x3af026(0x177)](_0x5626b5,_0x4c7aff,_0x5dcee0={}){const _0x56f084=a0_0x3af026,_0x5e1079=[],_0x213a42=await this['detectAvailableScanners'](),_0x541668=this['detectLanguage'](_0x5626b5);if(_0x5dcee0[_0x56f084(0x175)]!==![]&&this[_0x56f084(0x17c)](_0x5626b5))return this[_0x56f084(0x1c0)]?.[_0x56f084(0x17d)](_0x56f084(0x1b6),{'filePath':_0x5626b5}),[];if(_0x541668===_0x56f084(0x17b)||_0x541668===_0x56f084(0x185)){if(_0x213a42[_0x56f084(0x19d)]){const _0x27ea1b=await this[_0x56f084(0x1cf)](_0x5626b5,[_0x541668],_0x5dcee0);_0x5e1079['push'](..._0x27ea1b);}if(_0x213a42[_0x56f084(0x187)]){const _0x3fb475=await this[_0x56f084(0x1d2)](_0x5626b5,_0x4c7aff,_0x5dcee0);_0x5e1079['push'](..._0x3fb475);}}if(_0x541668===_0x56f084(0x18f)){if(_0x213a42['bandit']){const _0x4fdb6d=await this['runBandit'](_0x5626b5,_0x5dcee0);_0x5e1079['push'](..._0x4fdb6d);}if(_0x213a42['semgrep']){const _0x3664b5=await this['runSemgrep'](_0x5626b5,[_0x541668],_0x5dcee0);_0x5e1079['push'](..._0x3664b5);}}return _0x5e1079['length']===0x0&&!this['hasScannersForLanguage'](_0x213a42,_0x541668)&&this['logger']?.['warn']('No\x20security\x20scanners\x20available\x20for\x20language',{'language':_0x541668,'filePath':_0x5626b5}),this[_0x56f084(0x1aa)](_0x5e1079);}async['analyzeProject'](_0x5c4429,_0x4c873b,_0x1e7af3={}){const _0x1933dc=a0_0x3af026,_0x56a931=[],_0x2ba275=await this['detectAvailableScanners']();if(_0x4c873b===_0x1933dc(0x17b)||_0x4c873b==='typescript'){if(_0x2ba275['npmAudit']){const _0x155480=await this[_0x1933dc(0x1d3)](_0x5c4429,_0x1e7af3);_0x56a931[_0x1933dc(0x1a3)](..._0x155480);}}if(_0x4c873b===_0x1933dc(0x18f)){if(_0x2ba275[_0x1933dc(0x1c1)]){const _0x4ebfa4=await this['runPipAudit'](_0x5c4429,_0x1e7af3);_0x56a931['push'](..._0x4ebfa4);}}return this['normalizeResults'](_0x56a931);}async[a0_0x3af026(0x1cf)](_0x401fee,_0x59ae76,_0x3bbc45={}){const _0x25ca8b=a0_0x3af026;try{const _0x491c29=a0_0x41c490[_0x25ca8b(0x1cb)](_0x401fee),_0x208300=await execAsync('semgrep\x20--config=auto\x20--json\x20\x22'+_0x401fee+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530,'cwd':_0x491c29}),_0x39cedd=JSON['parse'](_0x208300[_0x25ca8b(0x1a5)]);return this[_0x25ca8b(0x189)](_0x39cedd);}catch(_0x27d715){if(_0x27d715['stdout'])try{const _0x3b170a=JSON['parse'](_0x27d715['stdout']);return this['parseSemgrepResults'](_0x3b170a);}catch(_0x4470d6){this[_0x25ca8b(0x1c0)]?.['error']('Failed\x20to\x20parse\x20Semgrep\x20output',{'error':_0x4470d6[_0x25ca8b(0x1b4)],'stdout':_0x27d715['stdout']});}return this['logger']?.[_0x25ca8b(0x1ab)](_0x25ca8b(0x1e4),{'error':_0x27d715['message']}),[];}}['parseSemgrepResults'](_0x2b0c80){const _0x3457ce=a0_0x3af026,_0x514f2e=[];if(_0x2b0c80[_0x3457ce(0x1a2)]&&Array['isArray'](_0x2b0c80[_0x3457ce(0x1a2)]))for(const _0x4f10d8 of _0x2b0c80[_0x3457ce(0x1a2)]){_0x514f2e['push']({'file':_0x4f10d8[_0x3457ce(0x18e)],'line':_0x4f10d8['start']?.[_0x3457ce(0x1a9)]||0x1,'column':_0x4f10d8[_0x3457ce(0x1d0)]?.[_0x3457ce(0x194)]||0x1,'severity':this['mapSemgrepSeverity'](_0x4f10d8[_0x3457ce(0x19e)]?.[_0x3457ce(0x1b0)]),'rule':_0x4f10d8[_0x3457ce(0x1d1)],'message':_0x4f10d8[_0x3457ce(0x19e)]?.['message']||_0x4f10d8[_0x3457ce(0x19e)]?.[_0x3457ce(0x1bf)]||_0x3457ce(0x178),'category':'security','scanner':'semgrep','cwe':_0x4f10d8['extra']?.['metadata']?.[_0x3457ce(0x180)],'owasp':_0x4f10d8['extra']?.[_0x3457ce(0x18b)]?.[_0x3457ce(0x1da)],'confidence':_0x4f10d8['extra']?.[_0x3457ce(0x18b)]?.[_0x3457ce(0x1c7)],'references':_0x4f10d8['extra']?.[_0x3457ce(0x18b)]?.[_0x3457ce(0x1a8)]});}return _0x514f2e;}async[a0_0x3af026(0x1a1)](_0x4ac52e,_0x1747a0={}){const _0x430de7=a0_0x3af026;try{const _0x1c2626=await execAsync(_0x430de7(0x1b2)+_0x4ac52e+'\x22',{'maxBuffer':0xa*0x400*0x400,'timeout':0x7530}),_0x32c04d=JSON[_0x430de7(0x1b7)](_0x1c2626[_0x430de7(0x1a5)]);return this[_0x430de7(0x1b9)](_0x32c04d);}catch(_0x166c4c){if(_0x166c4c[_0x430de7(0x1a5)])try{const _0x4a0e08=JSON['parse'](_0x166c4c[_0x430de7(0x1a5)]);return this[_0x430de7(0x1b9)](_0x4a0e08);}catch(_0x3af3ab){this[_0x430de7(0x1c0)]?.['error']('Failed\x20to\x20parse\x20Bandit\x20output',{'error':_0x3af3ab['message']});}return this['logger']?.[_0x430de7(0x1ab)]('Bandit\x20scan\x20failed',{'error':_0x166c4c['message']}),[];}}['parseBanditResults'](_0x30866b){const _0x4ea54e=a0_0x3af026,_0x112006=[];if(_0x30866b['results']&&Array['isArray'](_0x30866b[_0x4ea54e(0x1a2)]))for(const _0x206eef of _0x30866b['results']){_0x112006['push']({'file':_0x206eef[_0x4ea54e(0x191)],'line':_0x206eef['line_number']||0x1,'column':_0x206eef[_0x4ea54e(0x1b5)]||0x1,'severity':this['mapBanditSeverity'](_0x206eef['issue_severity']),'rule':_0x206eef['test_id'],'message':_0x206eef[_0x4ea54e(0x179)],'category':'security','scanner':'bandit','cwe':_0x206eef[_0x4ea54e(0x1c5)]?.['id']?_0x4ea54e(0x172)+_0x206eef['issue_cwe']['id']:null,'confidence':_0x206eef[_0x4ea54e(0x1be)],'moreInfo':_0x206eef['more_info']});}return _0x112006;}async['runESLintSecurity'](_0x3fc2cb,_0x176128,_0xe74c40={}){const _0x26bb9f=a0_0x3af026;try{const {ESLint:_0x56dfb2}=await import('eslint'),_0x508fcf=new _0x56dfb2({'overrideConfig':{'plugins':[_0x26bb9f(0x19f)],'extends':[_0x26bb9f(0x1c4)],'parserOptions':{'ecmaVersion':'latest','sourceType':'module'}},'useEslintrc':![]}),_0x2b3dc5=await _0x508fcf['lintText'](_0x176128,{'filePath':_0x3fc2cb});return this[_0x26bb9f(0x17f)](_0x2b3dc5,_0x3fc2cb);}catch(_0x559e3b){return this[_0x26bb9f(0x1c0)]?.['error']('ESLint\x20security\x20scan\x20failed',{'error':_0x559e3b['message'],'filePath':_0x3fc2cb}),[];}}[a0_0x3af026(0x17f)](_0x523be1,_0x16f8fa){const _0x396d3c=a0_0x3af026,_0x1ff07f=[];for(const _0x3d8c04 of _0x523be1){if(_0x3d8c04['messages']&&Array['isArray'](_0x3d8c04[_0x396d3c(0x182)]))for(const _0x105be0 of _0x3d8c04[_0x396d3c(0x182)]){_0x105be0[_0x396d3c(0x1bd)]&&_0x105be0[_0x396d3c(0x1bd)]['startsWith'](_0x396d3c(0x19b))&&_0x1ff07f[_0x396d3c(0x1a3)]({'file':_0x16f8fa,'line':_0x105be0[_0x396d3c(0x1a9)]||0x1,'column':_0x105be0[_0x396d3c(0x1bc)]||0x1,'severity':this[_0x396d3c(0x1df)](_0x105be0['severity']),'rule':_0x105be0['ruleId'],'message':_0x105be0[_0x396d3c(0x1b4)],'category':'security','scanner':_0x396d3c(0x183),'fixable':_0x105be0['fix']!==undefined});}}return _0x1ff07f;}async['runNpmAudit'](_0x2f5286,_0x270025={}){const _0xb88e30=a0_0x3af026;try{const _0x448346=a0_0x41c490['join'](_0x2f5286,_0xb88e30(0x18a));try{await a0_0xf94c0d['access'](_0x448346);}catch{return this['logger']?.['debug'](_0xb88e30(0x1bb)),[];}const _0x3f19d3=await execAsync('npm\x20audit\x20--json',{'cwd':_0x2f5286,'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x1daf3c=JSON[_0xb88e30(0x1b7)](_0x3f19d3['stdout']);return this[_0xb88e30(0x1ca)](_0x1daf3c);}catch(_0x4fddca){if(_0x4fddca[_0xb88e30(0x1a5)])try{const _0x4934fd=JSON[_0xb88e30(0x1b7)](_0x4fddca['stdout']);return this['parseNpmAuditResults'](_0x4934fd);}catch(_0x2d6f05){this[_0xb88e30(0x1c0)]?.['error'](_0xb88e30(0x18d),{'error':_0x2d6f05['message']});}return[];}}['parseNpmAuditResults'](_0x4de78e){const _0x713297=a0_0x3af026,_0x367553=[];if(_0x4de78e['vulnerabilities'])for(const [_0x2eb6b0,_0x51139c]of Object['entries'](_0x4de78e[_0x713297(0x171)])){_0x367553['push']({'file':'package.json','line':0x1,'column':0x1,'severity':this['mapNpmSeverity'](_0x51139c[_0x713297(0x1b0)]),'rule':'npm-'+(_0x51139c[_0x713297(0x1a7)][0x0]?.['source']||'advisory'),'message':_0x2eb6b0+':\x20'+(_0x51139c[_0x713297(0x1a7)][0x0]?.['title']||'Security\x20vulnerability'),'category':'security','scanner':_0x713297(0x17e),'package':_0x2eb6b0,'vulnerableVersions':_0x51139c['range'],'patchedVersions':_0x51139c['fixAvailable']?'Available':_0x713297(0x1ce),'cve':_0x51139c['via'][0x0]?.['cve'],'cvss':_0x51139c[_0x713297(0x1a7)][0x0]?.['cvss'],'references':_0x51139c['via'][0x0]?.[_0x713297(0x190)]?[_0x51139c['via'][0x0][_0x713297(0x190)]]:[]});}return _0x367553;}async['runPipAudit'](_0x5f136a,_0x370147={}){const _0x1ce2d5=a0_0x3af026;try{const requirementsPath=a0_0x41c490['join'](_0x5f136a,'requirements.txt');try{await a0_0xf94c0d['access'](requirementsPath);}catch{return this[_0x1ce2d5(0x1c0)]?.[_0x1ce2d5(0x17d)]('No\x20requirements.txt\x20found,\x20skipping\x20pip-audit'),[];}const _0x429a13=await execAsync(_0x1ce2d5(0x1dd),{'cwd':_0x5f136a,'maxBuffer':0xa*0x400*0x400,'timeout':0xea60}),_0x2248eb=JSON['parse'](_0x429a13[_0x1ce2d5(0x1a5)]);return this['parsePipAuditResults'](_0x2248eb);}catch(_0x22ed47){if(_0x22ed47['stdout'])try{const _0x542926=JSON[_0x1ce2d5(0x1b7)](_0x22ed47[_0x1ce2d5(0x1a5)]);return this['parsePipAuditResults'](_0x542926);}catch(_0x3d5fd3){this['logger']?.['error']('Failed\x20to\x20parse\x20pip-audit\x20output',{'error':_0x3d5fd3['message']});}return[];}}['parsePipAuditResults'](_0x32ed88){const _0x53517b=a0_0x3af026,_0x2f90ab=[];if(_0x32ed88[_0x53517b(0x195)]&&Array['isArray'](_0x32ed88['dependencies']))for(const _0x1d34d5 of _0x32ed88[_0x53517b(0x195)]){if(_0x1d34d5['vulns']&&Array['isArray'](_0x1d34d5['vulns']))for(const _0x381d38 of _0x1d34d5[_0x53517b(0x1a4)]){_0x2f90ab[_0x53517b(0x1a3)]({'file':_0x53517b(0x1d8),'line':0x1,'column':0x1,'severity':this[_0x53517b(0x18c)](_0x381d38['severity']),'rule':_0x381d38['id'],'message':_0x1d34d5[_0x53517b(0x1de)]+':\x20'+(_0x381d38['description']||'Security\x20vulnerability'),'category':_0x53517b(0x19f),'scanner':_0x53517b(0x1d5),'package':_0x1d34d5['name'],'vulnerableVersion':_0x1d34d5[_0x53517b(0x1b3)],'fixedVersions':_0x381d38['fix_versions'],'references':_0x381d38[_0x53517b(0x199)]||[]});}}return _0x2f90ab;}[a0_0x3af026(0x1ad)](_0x41a7ca){const _0x28d5ad=a0_0x3af026,_0x245f3d=a0_0x41c490['extname'](_0x41a7ca)['toLowerCase'](),_0x5f6588={'.js':_0x28d5ad(0x17b),'.jsx':'javascript','.mjs':_0x28d5ad(0x17b),'.cjs':_0x28d5ad(0x17b),'.ts':_0x28d5ad(0x185),'.tsx':'typescript','.py':_0x28d5ad(0x18f)};return _0x5f6588[_0x245f3d]||null;}[a0_0x3af026(0x17c)](_0x338020){const _0x17e046=a0_0x3af026,_0x589b2c=[/\.test\./,/\.spec\./,/__tests__\//,/\/tests?\//,/\.test$/,/\.spec$/];return _0x589b2c[_0x17e046(0x1d7)](_0x2f2277=>_0x2f2277['test'](_0x338020));}['hasScannersForLanguage'](_0x19964f,_0x29fb57){const _0x59ac37=a0_0x3af026;if(_0x29fb57==='javascript'||_0x29fb57==='typescript')return _0x19964f['semgrep']||_0x19964f['eslintSecurity'];if(_0x29fb57===_0x59ac37(0x18f))return _0x19964f['bandit']||_0x19964f['semgrep'];return![];}[a0_0x3af026(0x1aa)](_0x3daed1){const _0x32c2a2=a0_0x3af026;return _0x3daed1['map'](_0x31d151=>({'file':_0x31d151['file'],'line':_0x31d151['line']||0x1,'column':_0x31d151[_0x32c2a2(0x1bc)]||0x1,'severity':_0x31d151[_0x32c2a2(0x1b0)]||STATIC_ANALYSIS['SEVERITY']['WARNING'],'rule':_0x31d151['rule']||_0x32c2a2(0x19a),'message':_0x31d151[_0x32c2a2(0x1b4)]||'Security\x20issue\x20detected','category':'security','scanner':_0x31d151['scanner'],'cwe':_0x31d151[_0x32c2a2(0x180)]||null,'owasp':_0x31d151['owasp']||null,'confidence':_0x31d151[_0x32c2a2(0x1c7)]||null,'fixable':_0x31d151['fixable']||![],'remediation':_0x31d151['remediation']||_0x31d151[_0x32c2a2(0x176)]||null,'references':_0x31d151[_0x32c2a2(0x1a8)]||[],'package':_0x31d151[_0x32c2a2(0x170)]||null}));}['mapSemgrepSeverity'](_0x54d885){const _0x32e285=a0_0x3af026,_0x282624={'ERROR':STATIC_ANALYSIS['SEVERITY'][_0x32e285(0x192)],'WARNING':STATIC_ANALYSIS[_0x32e285(0x1dc)]['ERROR'],'INFO':STATIC_ANALYSIS[_0x32e285(0x1dc)]['WARNING']};return _0x282624[_0x54d885?.[_0x32e285(0x174)]()]||STATIC_ANALYSIS[_0x32e285(0x1dc)][_0x32e285(0x1b8)];}['mapBanditSeverity'](_0x22b4ca){const _0x438038=a0_0x3af026,_0x28160e={'HIGH':STATIC_ANALYSIS[_0x438038(0x1dc)][_0x438038(0x192)],'MEDIUM':STATIC_ANALYSIS['SEVERITY']['ERROR'],'LOW':STATIC_ANALYSIS['SEVERITY']['WARNING']};return _0x28160e[_0x22b4ca?.['toUpperCase']()]||STATIC_ANALYSIS['SEVERITY'][_0x438038(0x1b8)];}['mapESLintSeverity'](_0x1bc16a){const _0x39286e=a0_0x3af026;return _0x1bc16a===0x2?STATIC_ANALYSIS['SEVERITY']['ERROR']:STATIC_ANALYSIS[_0x39286e(0x1dc)][_0x39286e(0x1b8)];}[a0_0x3af026(0x1c8)](_0x23d8cb){const _0x5f5369=a0_0x3af026,_0x3be271={'critical':STATIC_ANALYSIS[_0x5f5369(0x1dc)]['CRITICAL'],'high':STATIC_ANALYSIS['SEVERITY']['CRITICAL'],'moderate':STATIC_ANALYSIS['SEVERITY'][_0x5f5369(0x1b1)],'low':STATIC_ANALYSIS['SEVERITY'][_0x5f5369(0x1b8)],'info':STATIC_ANALYSIS[_0x5f5369(0x1dc)]['INFO']};return _0x3be271[_0x23d8cb?.[_0x5f5369(0x1db)]()]||STATIC_ANALYSIS['SEVERITY'][_0x5f5369(0x1b8)];}['mapPipAuditSeverity'](_0x518489){const _0x5613e9=a0_0x3af026;if(!_0x518489)return STATIC_ANALYSIS[_0x5613e9(0x1dc)][_0x5613e9(0x1b1)];const _0x2e397a={'critical':STATIC_ANALYSIS[_0x5613e9(0x1dc)]['CRITICAL'],'high':STATIC_ANALYSIS['SEVERITY'][_0x5613e9(0x192)],'medium':STATIC_ANALYSIS['SEVERITY']['ERROR'],'low':STATIC_ANALYSIS[_0x5613e9(0x1dc)]['WARNING']};return _0x2e397a[_0x518489?.['toLowerCase']()]||STATIC_ANALYSIS[_0x5613e9(0x1dc)][_0x5613e9(0x1b1)];}async['getScannerStatus'](){const _0x2c553d=a0_0x3af026,_0xf57cc4=await this[_0x2c553d(0x1d6)]();return{'scanners':_0xf57cc4,'recommendations':this[_0x2c553d(0x1c2)](_0xf57cc4)};}['getInstallRecommendations'](_0x2ae0bf){const _0x3903a6=a0_0x3af026,_0x307eb2=[];return!_0x2ae0bf[_0x3903a6(0x19d)]&&_0x307eb2['push']({'scanner':_0x3903a6(0x1ba),'reason':'Multi-language\x20SAST\x20with\x20extensive\x20security\x20rules','install':_0x3903a6(0x1af),'priority':'high'}),!_0x2ae0bf['bandit']&&_0x307eb2[_0x3903a6(0x1a3)]({'scanner':'Bandit','reason':_0x3903a6(0x186),'install':'pip\x20install\x20bandit','priority':'medium'}),!_0x2ae0bf['eslintSecurity']&&_0x307eb2['push']({'scanner':'eslint-plugin-security','reason':_0x3903a6(0x1e1),'install':'npm\x20install\x20--save-dev\x20eslint-plugin-security','priority':'medium'}),!_0x2ae0bf[_0x3903a6(0x1c1)]&&_0x307eb2['push']({'scanner':'pip-audit','reason':'Python\x20dependency\x20vulnerability\x20scanner','install':'pip\x20install\x20pip-audit','priority':'low'}),_0x307eb2;}}export default SecurityAnalyzer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x199c9b=a0_0x42ef;function a0_0x570d(){const _0x3c1825=['ntzADNLhwLu','rvnozxH0','y3jLyxrLu291CMnLrMLSzq','ChvZAa','BgLUzq','Dw5RBM93BG','zMLSzu5HBwu','zxjYB3i','Dg9mB3DLCKnHC2u','mJGYngXlBgvdvW','u3vNz2vZDgLVBG','BgLIlMqUDhm','mJa4ndrzu0f6Ae8','vhLWzvnJCMLWDcbHBMfSExnPCYbJB21WBgv0zwq','mJq1ndK3A1veA3Hv','vhLWzvnJCMLWDcbHBMfSExnPCYbMywLSzwq','mte0ntC4mfzxC2DKBW','nZe0AhrJtKPP','tgf0zxn0','sNn4rw1PDa','y2HHCMfJDgvY','qw5HBhLZAxmGzMfPBgvKoIa','BwvZC2fNzq','C3rHCNq','owPTEMfdCW','zMLSDgvY','zMLSzq','zM9YBwf0rgLHz25VC3rPyW','v0fstKLorW','y3jLyxrLuhjVz3jHBq','su1qt1ju','CgfYC2veAwfNBM9ZDgLJCW','rgLHz25VC3rPy0nHDgvNB3j5','z2v0u3LUDgfJDgLJrgLHz25VC3rPy3m','rvjst1i','DhLWzq','mtrywLjzzeO','Aw5JBhvKzxm','y2fUBM90igzPBMqGBw9KDwXL','vfLqrq','mJq2ntaZmen6wMPNvW','u2nYAxb0vgfYz2v0','mZa3ntC2nw5IsMviCG','zgLYBMfTzq','z2v0u2vTyw50AwneAwfNBM9ZDgLJCW','BgvUz3rO','y29TCgLSzxjpChrPB25Z','zgvIDwC','Bg9Nz2vY','u0vwrvjjvfK','oda0odGYy2H3BKz5','Aw50zxjMywnL','q0furuDpuLK','tw9KDwXLuMvZB2X1DgLVBKTPBMq'];a0_0x570d=function(){return _0x3c1825;};return a0_0x570d();}(function(_0x47d40d,_0xe7f29e){const _0x432ff2=a0_0x42ef,_0xac623c=_0x47d40d();while(!![]){try{const _0x2ecc03=parseInt(_0x432ff2(0xd4))/0x1*(parseInt(_0x432ff2(0xf2))/0x2)+parseInt(_0x432ff2(0xf7))/0x3*(parseInt(_0x432ff2(0xef))/0x4)+parseInt(_0x432ff2(0xf6))/0x5+-parseInt(_0x432ff2(0xe2))/0x6+-parseInt(_0x432ff2(0xf4))/0x7*(parseInt(_0x432ff2(0xe6))/0x8)+parseInt(_0x432ff2(0xc8))/0x9*(parseInt(_0x432ff2(0xd8))/0xa)+-parseInt(_0x432ff2(0xda))/0xb;if(_0x2ecc03===_0xe7f29e)break;else _0xac623c['push'](_0xac623c['shift']());}catch(_0x2303ac){_0xac623c['push'](_0xac623c['shift']());}}}(a0_0x570d,0x1fd20));import a0_0xe6b2f9 from'typescript';import a0_0x4d7363 from'path';import{STATIC_ANALYSIS}from'../utilities/constants.js';class TypeScriptAnalyzer{constructor(_0xc6821b=null){const _0x115f78=a0_0x42ef;this['logger']=_0xc6821b,this['compilerOptions']={'noEmit':!![],'jsx':a0_0xe6b2f9[_0x115f78(0xc3)]['React'],'target':a0_0xe6b2f9['ScriptTarget']['Latest'],'module':a0_0xe6b2f9['ModuleKind'][_0x115f78(0xe7)],'moduleResolution':a0_0xe6b2f9[_0x115f78(0xe5)]['NodeJs'],'esModuleInterop':!![],'skipLibCheck':!![],'strict':!![],'noImplicitAny':!![],'strictNullChecks':!![],'strictFunctionTypes':!![],'allowJs':![]};}async['analyze'](_0xf58809,_0x416cc8,_0x241572={}){const _0x210113=a0_0x42ef;try{const _0x4f4623=[],_0x503b77=a0_0xe6b2f9[_0x210113(0xe8)](_0xf58809,_0x416cc8,a0_0xe6b2f9['ScriptTarget'][_0x210113(0xf8)],!![]),_0x22b462=this[_0x210113(0xd1)](_0x503b77);_0x4f4623[_0x210113(0xe9)](..._0x22b462);const _0x50c63f=await this[_0x210113(0xdc)](_0xf58809,_0x416cc8);return _0x4f4623['push'](..._0x50c63f),this[_0x210113(0xe0)]?.['debug'](_0x210113(0xf3),{'file':_0xf58809,'totalDiagnostics':_0x4f4623[_0x210113(0xdd)],'errors':_0x4f4623[_0x210113(0xc9)](_0x162ecf=>_0x162ecf['severity']===STATIC_ANALYSIS[_0x210113(0xe1)][_0x210113(0xd2)])['length'],'warnings':_0x4f4623['filter'](_0x12d1ee=>_0x12d1ee['severity']===STATIC_ANALYSIS['SEVERITY'][_0x210113(0xcc)])['length']}),_0x4f4623;}catch(_0x50c2c2){return this[_0x210113(0xe0)]?.[_0x210113(0xed)](_0x210113(0xf5),{'file':_0xf58809,'error':_0x50c2c2[_0x210113(0xc6)]}),[{'file':_0xf58809,'line':0x0,'column':0x0,'severity':STATIC_ANALYSIS[_0x210113(0xe1)][_0x210113(0xd2)],'rule':'analyzer-error','message':_0x210113(0xc5)+_0x50c2c2[_0x210113(0xc6)],'category':STATIC_ANALYSIS[_0x210113(0xe4)]['SYNTAX']}];}}[a0_0x199c9b(0xd1)](_0x29c467){const _0x4391ed=a0_0x199c9b,_0x201fc1=[];if(_0x29c467[_0x4391ed(0xcf)]&&_0x29c467[_0x4391ed(0xcf)]['length']>0x0)for(const _0x4d687b of _0x29c467[_0x4391ed(0xcf)]){_0x201fc1[_0x4391ed(0xe9)](this['formatDiagnostic'](_0x4d687b,_0x29c467));}return _0x201fc1;}async['getSemanticDiagnostics'](_0x400ad9,_0x20e0d9){const _0x221c84=a0_0x199c9b,_0x13a7c5=[];try{const _0x350945=a0_0xe6b2f9['createSourceFile'](_0x400ad9,_0x20e0d9,a0_0xe6b2f9[_0x221c84(0xd9)][_0x221c84(0xf8)],!![]),_0x535299={'getSourceFile':_0x413483=>{if(_0x413483===_0x400ad9)return _0x350945;return undefined;},'getDefaultLibFileName':()=>_0x221c84(0xf1),'writeFile':()=>{},'getCurrentDirectory':()=>a0_0x4d7363[_0x221c84(0xdb)](_0x400ad9),'getDirectories':()=>[],'fileExists':_0x1ccb1f=>_0x1ccb1f===_0x400ad9,'readFile':_0x118723=>{if(_0x118723===_0x400ad9)return _0x20e0d9;return undefined;},'getCanonicalFileName':_0x382af9=>_0x382af9,'useCaseSensitiveFileNames':()=>!![],'getNewLine':()=>'\x0a'},_0x4689d2=a0_0xe6b2f9[_0x221c84(0xcd)]({'rootNames':[_0x400ad9],'options':this[_0x221c84(0xde)],'host':_0x535299}),_0x4ec4fd=_0x4689d2[_0x221c84(0xd1)](_0x350945),_0x1de6e3=_0x4689d2[_0x221c84(0xdc)](_0x350945);for(const _0x39fc7a of[..._0x4ec4fd,..._0x1de6e3]){_0x13a7c5['push'](this[_0x221c84(0xcb)](_0x39fc7a,_0x350945));}}catch(_0x382d21){this['logger']?.[_0x221c84(0xdf)]('Semantic\x20analysis\x20encountered\x20error',{'file':_0x400ad9,'error':_0x382d21[_0x221c84(0xc6)]});}return _0x13a7c5;}['formatDiagnostic'](_0x54f6a4,_0x2b2246){const _0x521aab=a0_0x199c9b;let _0x38d840=0x0,_0x59e549=0x0;if(_0x54f6a4[_0x521aab(0xca)]&&_0x54f6a4['start']!==undefined){const _0x142c65=_0x54f6a4[_0x521aab(0xca)]['getLineAndCharacterOfPosition'](_0x54f6a4['start']);_0x38d840=_0x142c65[_0x521aab(0xea)]+0x1,_0x59e549=_0x142c65[_0x521aab(0xc4)]+0x1;}else{if(_0x2b2246&&_0x54f6a4[_0x521aab(0xc7)]!==undefined){const _0x4b4450=_0x2b2246['getLineAndCharacterOfPosition'](_0x54f6a4['start']);_0x38d840=_0x4b4450['line']+0x1,_0x59e549=_0x4b4450['character']+0x1;}}const _0x22bf1f=a0_0xe6b2f9['flattenDiagnosticMessageText'](_0x54f6a4['messageText'],'\x0a');let _0x433479;switch(_0x54f6a4['category']){case a0_0xe6b2f9[_0x521aab(0xd0)]['Error']:_0x433479=STATIC_ANALYSIS[_0x521aab(0xe1)]['ERROR'];break;case a0_0xe6b2f9['DiagnosticCategory']['Warning']:_0x433479=STATIC_ANALYSIS[_0x521aab(0xe1)][_0x521aab(0xcc)];break;case a0_0xe6b2f9[_0x521aab(0xd0)]['Message']:case a0_0xe6b2f9['DiagnosticCategory'][_0x521aab(0xf0)]:_0x433479=STATIC_ANALYSIS['SEVERITY']['INFO'];break;default:_0x433479=STATIC_ANALYSIS[_0x521aab(0xe1)][_0x521aab(0xd2)];}let _0x54124b=STATIC_ANALYSIS['CATEGORY']['SYNTAX'];const _0x410a7a=_0x54f6a4['code'];if(_0x410a7a>=0x7d0&&_0x410a7a<0xbb8)_0x54124b=STATIC_ANALYSIS[_0x521aab(0xe4)]['TYPE'];else{if(_0x410a7a>=0x3e8&&_0x410a7a<0x7d0)_0x54124b=STATIC_ANALYSIS['CATEGORY']['SYNTAX'];else _0x410a7a>=0x8fc&&_0x410a7a<0x960&&(_0x54124b=STATIC_ANALYSIS['CATEGORY']['IMPORT']);}const _0x5ef464=_0x22bf1f[_0x521aab(0xee)]();if(_0x5ef464[_0x521aab(0xd5)](_0x521aab(0xd6))||_0x5ef464[_0x521aab(0xd5)]('import')||_0x5ef464['includes']('export'))_0x54124b=STATIC_ANALYSIS[_0x521aab(0xe4)][_0x521aab(0xce)];else(_0x5ef464['includes'](_0x521aab(0xd3))||_0x5ef464['includes'](_0x521aab(0xe3))||_0x5ef464[_0x521aab(0xd5)]('class'))&&(_0x54124b=STATIC_ANALYSIS[_0x521aab(0xe4)][_0x521aab(0xd7)]);return{'file':_0x54f6a4[_0x521aab(0xca)]?.['fileName']||_0x2b2246?.[_0x521aab(0xec)]||_0x521aab(0xeb),'line':_0x38d840,'column':_0x59e549,'severity':_0x433479,'rule':'TS'+_0x410a7a,'message':_0x22bf1f,'category':_0x54124b,'fixable':![],'code':_0x54f6a4['code']};}}function a0_0x42ef(_0x16cf4d,_0x2fbcba){_0x16cf4d=_0x16cf4d-0xc3;const _0x570d93=a0_0x570d();let _0x42ef8f=_0x570d93[_0x16cf4d];if(a0_0x42ef['SQityJ']===undefined){var _0x23d741=function(_0x40ff98){const _0x3e3c71='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xe6b2f9='',_0x4d7363='';for(let _0xc6821b=0x0,_0xf58809,_0x416cc8,_0x241572=0x0;_0x416cc8=_0x40ff98['charAt'](_0x241572++);~_0x416cc8&&(_0xf58809=_0xc6821b%0x4?_0xf58809*0x40+_0x416cc8:_0x416cc8,_0xc6821b++%0x4)?_0xe6b2f9+=String['fromCharCode'](0xff&_0xf58809>>(-0x2*_0xc6821b&0x6)):0x0){_0x416cc8=_0x3e3c71['indexOf'](_0x416cc8);}for(let _0x4f4623=0x0,_0x503b77=_0xe6b2f9['length'];_0x4f4623<_0x503b77;_0x4f4623++){_0x4d7363+='%'+('00'+_0xe6b2f9['charCodeAt'](_0x4f4623)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d7363);};a0_0x42ef['DGlBso']=_0x23d741,a0_0x42ef['VFCCjt']={},a0_0x42ef['SQityJ']=!![];}const _0x55f19b=_0x570d93[0x0],_0x19c75c=_0x16cf4d+_0x55f19b,_0x1301fd=a0_0x42ef['VFCCjt'][_0x19c75c];return!_0x1301fd?(_0x42ef8f=a0_0x42ef['DGlBso'](_0x42ef8f),a0_0x42ef['VFCCjt'][_0x19c75c]=_0x42ef8f):_0x42ef8f=_0x1301fd,_0x42ef8f;}export default TypeScriptAnalyzer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a0_0x461db3=a0_0x51a8;(function(_0x5ec752,_0x278a96){const _0x2937ab=a0_0x51a8,_0x33dba2=_0x5ec752();while(!![]){try{const _0x2b3f28=-parseInt(_0x2937ab(0xcf))/0x1*(parseInt(_0x2937ab(0xb9))/0x2)+-parseInt(_0x2937ab(0xcb))/0x3+-parseInt(_0x2937ab(0xaa))/0x4+-parseInt(_0x2937ab(0xdd))/0x5+parseInt(_0x2937ab(0xdb))/0x6+parseInt(_0x2937ab(0xb5))/0x7*(parseInt(_0x2937ab(0xc9))/0x8)+parseInt(_0x2937ab(0xbf))/0x9;if(_0x2b3f28===_0x278a96)break;else _0x33dba2['push'](_0x33dba2['shift']());}catch(_0x1a5bf2){_0x33dba2['push'](_0x33dba2['shift']());}}}(a0_0x1ee7,0xaa689));function a0_0x1ee7(){const _0x3109f0=['zxn0Aw1HDgvfzMzVCNq','z2vUzxjHDgvszwzHy3rVCMLUz0fKDMLJzq','ChvZAa','nc4GuMvWBgfJzsbHBgWGAw5ZDgfUy2vZihDPDgGGy2fSBhmGDg8GDgHLig5LDYbMDw5JDgLVBG','BwLU','zhvWBgLJyxrLzeXPBMvZ','y2fSy3vSyxrLsw1Wywn0u2nVCMu','BgvUz3rO','mZjPD0LRyvy','zw5KtgLUzq','mtiZotq0mu5cEvzrvG','qw5HBhL6Aw5NignSB25LCYbMB3iGCMvMywn0B3jPBMCGB3bWB3j0Dw5PDgLLCY4UlG','y29Kzq','y2fSy3vSyxrLtwv0CMLJCW','mu9ovLzvzq','zwXZzq','Dhj1BMnHDgvdB2rL','Dg9vChbLCKnHC2u','Bg9NmG','CM91BMq','igXVy2f0Aw9UCW','lcbHBMqGCMvKDwnLignVzguGC2L6zq','AM9PBG','zM9YrwfJAa','Bwv0CMLJCW','rNvUy3rPB24','mJKYmtq5mhjiuwz0Aq','yMXVy2TZ','mtq2ntGYmfvnthftyW','zgv0zxjTAw5LuMvMywn0B3jPBMDtDhjHDgvNEq','C29Tzq','lIbuAgLZigLZigeGAgLNAc1PBxbHy3qGCMvMywn0B3jPBMCGB3bWB3j0Dw5PDhK','yw5HBhL6zunSB25LCW','mI4Gtw92zsbYzwXHDgvKig1LDgHVzhmGyw5KihbYB3bLCNrPzxmGAw50BYb0AguGy2XHC3m','zxH0CMfJDc1TB2r1Bgu','Bg93','zw50CMLLCW','DMfY','BwvKAxvT','y29UzMLKzw5Jzq','y2XVBMuT','zxH0CMfJDc1JBgfZCW','Aw1Wywn0u2nVCMu','ms4Gq3jLyxrLigeGBMv3ignSyxnZihrVigvUy2fWC3vSyxrLihrOAxmGzNvUy3rPB25HBgL0Eq','zxH0CMfJDgvKrNvUy3rPB24','z2vUzxjHDgvszwfZB25PBMC','Dg9gAxHLza','zgv0zxjTAw5LuhjPB3jPDhK','rwXPBwLUyxrLia','ms4GrxH0CMfJDcb0AguGzhvWBgLJyxrLzcbJB2rLihvZAw5Nia','mte3nty0nePWwLzdta','lcbYzxn1BhrPBMCGAw4G','y2HHCKf0','zgvZy3jPyMvczw5LzML0CW','CMv0DxjU','cI4UlIaODhj1BMnHDgvKkq','C2L6zq','y3jLyxrLrNvUy3rPB25oyw1L','z2vUzxjHDgvby3rPB25HyMXLu3rLChm','DhLWzq','C29YDa','mZeWnZiZsgvIsLPP','sw1WCM92zsbJB2rLig9Yz2fUAxPHDgLVBIbHy3jVC3mG','D2HPBgu','Aw5JBhvKzxm','mty5mJG1ogn3tK9nra','BwfW','zxH0CMfJDc1MDw5JDgLVBG','uMvMywn0B3jPBMCGDg8G','C3vNz2vZDe5HBwu','C3rHCNrmAw5L','mty5mJe1ntDzt3vot20','mI4GuMvWBgfJzsbHBgWGAw5ZDgfUy2vZihDPDgGGDgHLigv4DhjHy3rLzcb2zxjZAw9U'];a0_0x1ee7=function(){return _0x3109f0;};return a0_0x1ee7();}function a0_0x51a8(_0x1c5856,_0x5654fd){_0x1c5856=_0x1c5856-0xa5;const _0x1ee797=a0_0x1ee7();let _0x51a824=_0x1ee797[_0x1c5856];if(a0_0x51a8['fNXxci']===undefined){var _0xffe534=function(_0x4bdb18){const _0x2bf6cd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1aa994='',_0x13b87d='';for(let _0x58dad8=0x0,_0x15fc63,_0x3713c6,_0x226269=0x0;_0x3713c6=_0x4bdb18['charAt'](_0x226269++);~_0x3713c6&&(_0x15fc63=_0x58dad8%0x4?_0x15fc63*0x40+_0x3713c6:_0x3713c6,_0x58dad8++%0x4)?_0x1aa994+=String['fromCharCode'](0xff&_0x15fc63>>(-0x2*_0x58dad8&0x6)):0x0){_0x3713c6=_0x2bf6cd['indexOf'](_0x3713c6);}for(let _0xaf73e5=0x0,_0x4df00c=_0x1aa994['length'];_0xaf73e5<_0x4df00c;_0xaf73e5++){_0x13b87d+='%'+('00'+_0x1aa994['charCodeAt'](_0xaf73e5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x13b87d);};a0_0x51a8['rdOGYW']=_0xffe534,a0_0x51a8['etGnAn']={},a0_0x51a8['fNXxci']=!![];}const _0x29e26d=_0x1ee797[0x0],_0x336f83=_0x1c5856+_0x29e26d,_0x496477=a0_0x51a8['etGnAn'][_0x336f83];return!_0x496477?(_0x51a824=a0_0x51a8['rdOGYW'](_0x51a824),a0_0x51a8['etGnAn'][_0x336f83]=_0x51a824):_0x51a824=_0x496477,_0x51a824;}export class RefactoringAnalyzer{constructor(_0x1aa994){this['config']=_0x1aa994;}[a0_0x461db3(0xe1)](_0x13b87d){const _0x38adb6=a0_0x461db3;return console['log'](_0x38adb6(0xcc)),_0x13b87d['map']((_0x58dad8,_0x15fc63)=>{const _0x1a4e00=_0x38adb6,_0x3713c6=this[_0x1a4e00(0xce)](_0x58dad8),_0x226269=this[_0x1a4e00(0xc2)](_0x58dad8,_0x3713c6);return{'id':_0x1a4e00(0xe9)+(_0x15fc63+0x1),'type':_0x58dad8[_0x1a4e00(0xb3)],'confidence':_0x58dad8['confidence'],'instances':_0x58dad8['blocks'][_0x1a4e00(0xba)](_0xaf73e5=>({'file':_0xaf73e5['file'],'startLine':_0xaf73e5[_0x1a4e00(0xbe)],'endLine':_0xaf73e5[_0x1a4e00(0xca)],'code':this[_0x1a4e00(0xd1)](_0xaf73e5['code']),'fullCode':_0xaf73e5[_0x1a4e00(0xcd)],'blockType':_0xaf73e5[_0x1a4e00(0xb3)]})),'metrics':_0x3713c6,'refactoringAdvice':_0x226269};})[_0x38adb6(0xb4)]((_0x4df00c,_0x3742ae)=>_0x3742ae[_0x38adb6(0xd9)][_0x38adb6(0xeb)]-_0x4df00c[_0x38adb6(0xd9)]['impactScore']);}[a0_0x461db3(0xce)](_0x464031){const _0x329aef=a0_0x461db3,_0x135f24=_0x464031[_0x329aef(0xdc)],_0x832b3=_0x464031['tokenCount'],_0x1b1a8c=this['averageLineCount'](_0x135f24),_0xce326c=_0x135f24[_0x329aef(0xc8)],_0x43ffa8=this[_0x329aef(0xc7)](_0x832b3,_0x1b1a8c,_0xce326c,_0x464031[_0x329aef(0xe8)]),_0x492d6f=_0x1b1a8c*(_0xce326c-0x1),_0x5e1c7a=_0x832b3*(_0xce326c-0x1);return{'tokenCount':_0x832b3,'lineCount':_0x1b1a8c,'instanceCount':_0xce326c,'duplicatedLines':_0x492d6f,'duplicatedTokens':_0x5e1c7a,'impactScore':parseFloat(_0x43ffa8[_0x329aef(0xa6)](0x2)),'filesCovered':new Set(_0x135f24['map'](_0x4f2a61=>_0x4f2a61['file']))[_0x329aef(0xb0)]};}['calculateImpactScore'](_0x319c0e,_0x238db6,_0x18bfea,_0x4bebce){const _0x5ee108=a0_0x461db3,_0x42c90e=Math['log10'](_0x319c0e+0x1)*0x2,_0x363af1=Math[_0x5ee108(0xd3)](_0x18bfea+0x1)*0x3,_0x36e81d=_0x4bebce*0x2,_0x5c920d=Math[_0x5ee108(0xc5)](_0x238db6/0xa,0x3);return _0x42c90e+_0x363af1+_0x36e81d+_0x5c920d;}[a0_0x461db3(0xc2)](_0x461478,_0x404207){const _0x32ecd8=a0_0x461db3,_0x47f102=this['determineRefactoringStrategy'](_0x461478,_0x404207),_0x3c7622=this[_0x32ecd8(0xa7)](_0x404207),_0x23edf6=this[_0x32ecd8(0xbd)](_0x461478),_0x2bf18a=this[_0x32ecd8(0xa5)](_0x461478,_0x404207,_0x47f102),_0x2a0edf=this[_0x32ecd8(0xc1)](_0x404207,_0x47f102),_0x359345=this['describeBenefits'](_0x404207);return{'priority':_0x3c7622,'strategy':_0x47f102,'suggestedName':_0x23edf6,'reasoning':_0x2bf18a,'estimatedEffort':_0x2a0edf,'benefits':_0x359345,'actionableSteps':this['generateActionableSteps'](_0x47f102,_0x23edf6,_0x404207)};}[a0_0x461db3(0xde)](_0x46b453,_0x35ee28){const _0x8e5757=a0_0x461db3,{tokenCount:_0x480f17,lineCount:_0x4d829f,instanceCount:_0x2dd206,filesCovered:_0x552900}=_0x35ee28,_0x545dfc=_0x46b453[_0x8e5757(0xdc)]['map'](_0x123873=>_0x123873['type']),_0x1b32d2=_0x545dfc['some'](_0x31dc9f=>_0x31dc9f['includes'](_0x8e5757(0xda))||_0x31dc9f[_0x8e5757(0xb8)]('Method')),_0x5d1c3a=_0x545dfc[_0x8e5757(0xdf)](_0x3e00f7=>_0x3e00f7[_0x8e5757(0xb8)]('Class'));if(_0x5d1c3a&&_0x4d829f>0x32)return _0x8e5757(0xe3);else{if(_0x552900>0x2&&_0x480f17>0x64)return'extract-module';else{if(_0x1b32d2||_0x4d829f>=0xa&&_0x4d829f<=0x32)return'extract-function';else{if(_0x4d829f>0x32)return'extract-class';else return _0x4d829f<0xa?'extract-constant-or-utility':_0x8e5757(0xbb);}}}}['determinePriority'](_0x357a87){const _0x3601ec=a0_0x461db3,{impactScore:_0x1abbb3}=_0x357a87;if(_0x1abbb3>=0x8)return'high';if(_0x1abbb3>=0x5)return _0x3601ec(0xe7);return _0x3601ec(0xe4);}['suggestName'](_0x48c2be){const _0x1642d2=a0_0x461db3,_0x4ca06b=_0x48c2be[_0x1642d2(0xdc)][_0x1642d2(0xba)](_0x3ad166=>_0x3ad166['code'])['join']('\x20'),_0x1a8089=_0x4ca06b['match'](/[a-zA-Z_$][a-zA-Z0-9_$]*/g)||[],_0x4ff0ba={};_0x1a8089[_0x1642d2(0xd8)](_0x52b804=>{const _0xe3e232=_0x1642d2;if(['const','let',_0xe3e232(0xe6),'function',_0xe3e232(0xae),'if',_0xe3e232(0xd0),'for',_0xe3e232(0xb7)][_0xe3e232(0xb8)](_0x52b804))return;_0x4ff0ba[_0x52b804]=(_0x4ff0ba[_0x52b804]||0x0)+0x1;});const _0x14188b=Object[_0x1642d2(0xe5)](_0x4ff0ba)['sort']((_0x4c4814,_0xf52d0a)=>_0xf52d0a[0x1]-_0x4c4814[0x1])['slice'](0x0,0x3);if(_0x14188b[_0x1642d2(0xc8)]>0x0){const _0x40fb85=_0x14188b[_0x1642d2(0xba)](([_0x8e5389])=>_0x8e5389);return this[_0x1642d2(0xb1)](_0x40fb85);}return _0x1642d2(0xed);}['createFunctionName'](_0x439bff){const _0x5a69ca=a0_0x461db3;if(_0x439bff['length']===0x0)return _0x5a69ca(0xed);return _0x439bff[0x0]+_0x439bff['slice'](0x1)['map'](_0x779726=>_0x779726[_0x5a69ca(0xac)](0x0)[_0x5a69ca(0xd2)]()+_0x779726['slice'](0x1))[_0x5a69ca(0xd7)]('');}['generateReasoning'](_0x57b402,_0x34f638,_0x5bee84){const _0x1f8d30=a0_0x461db3,{instanceCount:_0x57ae0c,duplicatedLines:_0x13d33c,filesCovered:_0x244a96}=_0x34f638;let _0x4f0d60='This\x20'+_0x57b402['type']+'\x20code\x20pattern\x20appears\x20'+_0x57ae0c+'\x20times';return _0x244a96>0x1&&(_0x4f0d60+='\x20across\x20'+_0x244a96+'\x20different\x20files'),_0x4f0d60+=_0x1f8d30(0xab)+_0x13d33c+'\x20duplicated\x20lines.\x20',_0x4f0d60+=_0x1f8d30(0xbc)+_0x5bee84['replace'](/-/g,'\x20')+'\x20would\x20improve\x20maintainability',_0x57ae0c>=0x3&&(_0x4f0d60+=', reduce bugs from inconsistent changes'),_0x4f0d60+=_0x1f8d30(0xd6),_0x34f638[_0x1f8d30(0xeb)]>=0x8&&(_0x4f0d60+=_0x1f8d30(0xe0)),_0x4f0d60+'.';}[a0_0x461db3(0xc1)](_0x2ed142,_0x1734d7){const _0x4880cf=a0_0x461db3,{lineCount:_0x3d804a,instanceCount:_0x19ed64,filesCovered:_0x1928d2}=_0x2ed142;let _0x2d4906=0x0;_0x2d4906+=Math[_0x4880cf(0xc5)](_0x3d804a/0xa,0x5),_0x2d4906+=_0x19ed64*0.5,_0x2d4906+=_0x1928d2*0.5;if(_0x1734d7==='extract-module')_0x2d4906+=0x3;else{if(_0x1734d7===_0x4880cf(0xea))_0x2d4906+=0x2;else _0x1734d7==='extract-function'&&(_0x2d4906+=0x1);}if(_0x2d4906<=0x3)return _0x4880cf(0xe4);if(_0x2d4906<=0x7)return'medium';return'high';}[a0_0x461db3(0xad)](_0x4ada17){const _0x25e624=a0_0x461db3,_0x1e4d47=[];return _0x1e4d47['push'](_0x25e624(0xa8)+_0x4ada17[_0x25e624(0xc6)]+'\x20duplicated\x20lines\x20of\x20code'),_0x1e4d47[_0x25e624(0xc3)]('Improve\x20maintainability\x20by\x20centralizing\x20logic\x20in\x20one\x20place'),_0x4ada17['instanceCount']>=0x3&&_0x1e4d47['push']('Reduce\x20risk\x20of\x20inconsistent\x20changes\x20across\x20'+_0x4ada17['instanceCount']+_0x25e624(0xd5)),_0x4ada17['filesCovered']>0x2&&_0x1e4d47[_0x25e624(0xc3)](_0x25e624(0xb6)+_0x4ada17['filesCovered']+'\x20files'),_0x1e4d47['push']('Make\x20future\x20changes\x20easier\x20and\x20less\x20error-prone'),_0x1e4d47;}[a0_0x461db3(0xb2)](_0x523a0e,_0x2cf86d,_0x1d1736){const _0x4548ed=a0_0x461db3,_0x487f8f=[];switch(_0x523a0e){case'extract-function':_0x487f8f[_0x4548ed(0xc3)]('1.\x20Create\x20a\x20new\x20function\x20named\x20\x27'+_0x2cf86d+'\x27'),_0x487f8f[_0x4548ed(0xc3)]('2.\x20Move\x20the\x20duplicated\x20logic\x20into\x20this\x20function'),_0x487f8f['push']('3. Identify parameters needed from the surrounding context'),_0x487f8f[_0x4548ed(0xc3)](_0x4548ed(0xc4)),_0x487f8f['push']('5.\x20Test\x20to\x20ensure\x20behavior\x20is\x20preserved');break;case _0x4548ed(0xea):_0x487f8f[_0x4548ed(0xc3)](_0x4548ed(0xec)),_0x487f8f['push'](_0x4548ed(0xe2)),_0x487f8f['push']('3.\x20Update\x20all\x20instances\x20to\x20use\x20the\x20new\x20class'),_0x487f8f[_0x4548ed(0xc3)]('4.\x20Consider\x20dependency\x20injection\x20for\x20better\x20testability');break;case'extract-module':_0x487f8f[_0x4548ed(0xc3)]('1.\x20Create\x20a\x20new\x20module/file\x20for\x20this\x20shared\x20functionality'),_0x487f8f['push']('2.\x20Move\x20the\x20duplicated\x20code\x20into\x20the\x20new\x20module'),_0x487f8f['push']('3.\x20Export\x20the\x20necessary\x20functions/classes'),_0x487f8f['push']('4. Update all files to import from the new module'),_0x487f8f[_0x4548ed(0xc3)]('5.\x20Update\x20any\x20build\x20configurations\x20if\x20needed');break;default:_0x487f8f[_0x4548ed(0xc3)](_0x4548ed(0xa9)+_0x523a0e['replace'](/-/g,'\x20')),_0x487f8f['push'](_0x4548ed(0xc0)),_0x487f8f[_0x4548ed(0xc3)]('3.\x20Test\x20thoroughly');}return _0x487f8f;}['truncateCode'](_0x3a0977,_0x59db7b=0xa){const _0x5ddcb8=a0_0x461db3,_0x57d17f=_0x3a0977['split']('\x0a');if(_0x57d17f[_0x5ddcb8(0xc8)]<=_0x59db7b)return _0x3a0977;return _0x57d17f['slice'](0x0,_0x59db7b)['join']('\x0a')+_0x5ddcb8(0xaf);}['averageLineCount'](_0x548937){const _0x2cdc28=a0_0x461db3,_0x3c1820=_0x548937['reduce']((_0xb711d6,_0x2fd40d)=>_0xb711d6+(_0x2fd40d[_0x2cdc28(0xca)]-_0x2fd40d[_0x2cdc28(0xbe)]+0x1),0x0);return Math[_0x2cdc28(0xd4)](_0x3c1820/_0x548937['length']);}}
|
|
1
|
+
function a0_0x4bf0(){const _0x2a804c=['CM91BMq','AgLNAa','z2vUzxjHDgvszwfZB25PBMC','D2HPBgu','yMXVy2TZ','y29UzMLN','Aw5JBhvKzxm','z2vUzxjHDgvszwzHy3rVCMLUz0fKDMLJzq','y3jLyxrLrNvUy3rPB25oyw1L','C3rHCNrmAw5L','igr1CgXPy2f0zwqGBgLUzxmUia','Aw1Wywn0u2nVCMu','ChvZAa','C3vNz2vZDe5HBwu','zw5KtgLUzq','BwvKAxvT','cI4UlIaODhj1BMnHDgvKkq','nte0nZqYwezkEfPp','igXVy2f0Aw9UCW','zgvZy3jPyMvczw5LzML0CW','Bg9N','igfJCM9ZCYa','mI4GuMvWBgfJzsbHBgWGAw5ZDgfUy2vZihDPDgGGDgHLigv4DhjHy3rLzcb2zxjZAw9U','y2fSy3vSyxrLtwv0CMLJCW','z2vUzxjHDgvby3rPB25HyMXLu3rLChm','C29Tzq','Bg93','mZi5mZiYr094wMjj','mtyXnZC3n2nczeDWvG','zxH0CMfJDgvKrNvUy3rPB24','Aw5ZDgfUy2vdB3vUDa','BwfW','zxH0CMfJDc1TB2r1Bgu','Bwf0y2G','zwXZzq','vgHPCYa','BgvUz3rO','CMvWBgfJzq','CMvKDwnL','Dhj1BMnHDgvdB2rL','zgv0zxjTAw5LuMvMywn0B3jPBMDtDhjHDgvNEq','ns4GvxbKyxrLigfUEsbIDwLSzcbJB25MAwD1CMf0Aw9UCYbPzIbUzwvKzwq','Dg9gAxHLza','zMLSzxndB3zLCMvK','yw5HBhL6zunSB25LCW','nc4GuMvWBgfJzsbHBgWGAw5ZDgfUy2vZihDPDgGGy2fSBhmGDg8GDgHLig5LDYbMDw5JDgLVBG','mtqWmJy3nfbqzfr1Aq','y29Kzq','zxH0CMfJDc1MDw5JDgLVBG','Dg9Rzw5dB3vUDa','mJuWota0tNfoDM9n','ms4Gq3jLyxrLigeGBMv3ignSyxnZihrVigvUy2fWC3vSyxrLihrOAxmGzNvUy3rPB25HBgL0Eq','zMLSzq','y29UzMLKzw5Jzq','C29YDa','mI4Gtw92zsb0AguGzhvWBgLJyxrLzcbSB2DPyYbPBNrVihrOAxmGzNvUy3rPB24','mJm2mJi0yuXKA1vb','ndu4mdvTueHxEMK','Dg9vChbLCKnHC2u','q2XHC3m','zxn0Aw1HDgvfzMzVCNq','AM9PBG','BwLU','DhLWzq','ms4GrxH0CMfJDcb0AguGzhvWBgLJyxrLzcbJB2rLihvZAw5Nia','zxH0CMfJDc1JBgfZCW','zgv0zxjTAw5LuhjPB3jPDhK','C2XPy2u','twv0Ag9K','CMv0DxjU'];a0_0x4bf0=function(){return _0x2a804c;};return a0_0x4bf0();}const a0_0x23c83a=a0_0x21c5;function a0_0x21c5(_0x366f23,_0x4da73f){_0x366f23=_0x366f23-0x1f3;const _0x4bf01a=a0_0x4bf0();let _0x21c599=_0x4bf01a[_0x366f23];if(a0_0x21c5['FFYLuF']===undefined){var _0x3e1119=function(_0xd0787b){const _0x55f2bf='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x547c08='',_0xe0d6ed='';for(let _0x40eb16=0x0,_0xd2040a,_0x1a2b6a,_0x19385a=0x0;_0x1a2b6a=_0xd0787b['charAt'](_0x19385a++);~_0x1a2b6a&&(_0xd2040a=_0x40eb16%0x4?_0xd2040a*0x40+_0x1a2b6a:_0x1a2b6a,_0x40eb16++%0x4)?_0x547c08+=String['fromCharCode'](0xff&_0xd2040a>>(-0x2*_0x40eb16&0x6)):0x0){_0x1a2b6a=_0x55f2bf['indexOf'](_0x1a2b6a);}for(let _0x33a525=0x0,_0x3d486b=_0x547c08['length'];_0x33a525<_0x3d486b;_0x33a525++){_0xe0d6ed+='%'+('00'+_0x547c08['charCodeAt'](_0x33a525)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xe0d6ed);};a0_0x21c5['AuQRGT']=_0x3e1119,a0_0x21c5['TDAeVt']={},a0_0x21c5['FFYLuF']=!![];}const _0x4d7066=_0x4bf01a[0x0],_0x545aff=_0x366f23+_0x4d7066,_0x29ac2c=a0_0x21c5['TDAeVt'][_0x545aff];return!_0x29ac2c?(_0x21c599=a0_0x21c5['AuQRGT'](_0x21c599),a0_0x21c5['TDAeVt'][_0x545aff]=_0x21c599):_0x21c599=_0x29ac2c,_0x21c599;}(function(_0x2654bd,_0x158080){const _0x3b52b3=a0_0x21c5,_0x5907c6=_0x2654bd();while(!![]){try{const _0x53d70a=-parseInt(_0x3b52b3(0x218))/0x1+-parseInt(_0x3b52b3(0x1f7))/0x2+parseInt(_0x3b52b3(0x201))/0x3+parseInt(_0x3b52b3(0x21e))/0x4+parseInt(_0x3b52b3(0x21f))/0x5+parseInt(_0x3b52b3(0x214))/0x6+parseInt(_0x3b52b3(0x202))/0x7;if(_0x53d70a===_0x158080)break;else _0x5907c6['push'](_0x5907c6['shift']());}catch(_0x22916b){_0x5907c6['push'](_0x5907c6['shift']());}}}(a0_0x4bf0,0x20dce));export class RefactoringAnalyzer{constructor(_0x547c08){const _0x5e6686=a0_0x21c5;this[_0x5e6686(0x231)]=_0x547c08;}[a0_0x23c83a(0x212)](_0xe0d6ed){const _0x2b0c6f=a0_0x23c83a;return console[_0x2b0c6f(0x1fa)]('Analyzing\x20clones\x20for\x20refactoring\x20opportunities...'),_0xe0d6ed['map']((_0x40eb16,_0xd2040a)=>{const _0x2fc9cc=_0x2b0c6f,_0x1a2b6a=this[_0x2fc9cc(0x1fd)](_0x40eb16),_0x19385a=this['generateRefactoringAdvice'](_0x40eb16,_0x1a2b6a);return{'id':'clone-'+(_0xd2040a+0x1),'type':_0x40eb16['type'],'confidence':_0x40eb16[_0x2fc9cc(0x21b)],'instances':_0x40eb16[_0x2fc9cc(0x230)]['map'](_0x33a525=>({'file':_0x33a525[_0x2fc9cc(0x21a)],'startLine':_0x33a525['startLine'],'endLine':_0x33a525['endLine'],'code':this[_0x2fc9cc(0x20d)](_0x33a525[_0x2fc9cc(0x215)]),'fullCode':_0x33a525[_0x2fc9cc(0x215)],'blockType':_0x33a525['type']})),'metrics':_0x1a2b6a,'refactoringAdvice':_0x19385a};})[_0x2b0c6f(0x21c)]((_0x3d486b,_0x127d36)=>_0x127d36['metrics'][_0x2b0c6f(0x237)]-_0x3d486b['metrics'][_0x2b0c6f(0x237)]);}['calculateMetrics'](_0x1e1217){const _0x83c363=a0_0x23c83a,_0x123c32=_0x1e1217['blocks'],_0x1a8d8e=_0x1e1217[_0x83c363(0x217)],_0x180ba0=this['averageLineCount'](_0x123c32),_0x2ebcc8=_0x123c32[_0x83c363(0x20a)],_0x16e116=this['calculateImpactScore'](_0x1a8d8e,_0x180ba0,_0x2ebcc8,_0x1e1217[_0x83c363(0x21b)]),_0x338495=_0x180ba0*(_0x2ebcc8-0x1),_0x138196=_0x1a8d8e*(_0x2ebcc8-0x1);return{'tokenCount':_0x1a8d8e,'lineCount':_0x180ba0,'instanceCount':_0x2ebcc8,'duplicatedLines':_0x338495,'duplicatedTokens':_0x138196,'impactScore':parseFloat(_0x16e116[_0x83c363(0x210)](0x2)),'filesCovered':new Set(_0x123c32[_0x83c363(0x205)](_0x1a09bf=>_0x1a09bf['file']))['size']};}['calculateImpactScore'](_0x582219,_0x3dd1b5,_0x52c934,_0x33599d){const _0x34b17d=a0_0x23c83a,_0x184a89=Math['log10'](_0x582219+0x1)*0x2,_0xf31819=Math['log2'](_0x52c934+0x1)*0x3,_0x3b1f4c=_0x33599d*0x2,_0xaef145=Math[_0x34b17d(0x224)](_0x3dd1b5/0xa,0x3);return _0x184a89+_0xf31819+_0x3b1f4c+_0xaef145;}[a0_0x23c83a(0x233)](_0x3681f1,_0x44f204){const _0x1e92fd=a0_0x23c83a,_0x2001ad=this[_0x1e92fd(0x20e)](_0x3681f1,_0x44f204),_0x115d96=this[_0x1e92fd(0x228)](_0x44f204),_0x80ef42=this[_0x1e92fd(0x1f3)](_0x3681f1),_0x2d71e2=this['generateReasoning'](_0x3681f1,_0x44f204,_0x2001ad),_0x33743d=this[_0x1e92fd(0x222)](_0x44f204,_0x2001ad),_0x16cd0c=this[_0x1e92fd(0x1f9)](_0x44f204);return{'priority':_0x115d96,'strategy':_0x2001ad,'suggestedName':_0x80ef42,'reasoning':_0x2d71e2,'estimatedEffort':_0x33743d,'benefits':_0x16cd0c,'actionableSteps':this['generateActionableSteps'](_0x2001ad,_0x80ef42,_0x44f204)};}['determineRefactoringStrategy'](_0x131f5c,_0x31c1ff){const _0x5bb5c9=a0_0x23c83a,{tokenCount:_0xbc5e9f,lineCount:_0x3c581c,instanceCount:_0x419e98,filesCovered:_0xbc85f0}=_0x31c1ff,_0x32f68e=_0x131f5c['blocks'][_0x5bb5c9(0x205)](_0x214cfd=>_0x214cfd[_0x5bb5c9(0x225)]),_0x2db07b=_0x32f68e[_0x5bb5c9(0x1ff)](_0xda9bb5=>_0xda9bb5['includes']('Function')||_0xda9bb5[_0x5bb5c9(0x232)](_0x5bb5c9(0x22a))),_0xfe7162=_0x32f68e[_0x5bb5c9(0x1ff)](_0x335e3f=>_0x335e3f[_0x5bb5c9(0x232)](_0x5bb5c9(0x221)));if(_0xfe7162&&_0x3c581c>0x32)return'extract-module';else{if(_0xbc85f0>0x2&&_0xbc5e9f>0x64)return'extract-module';else{if(_0x2db07b||_0x3c581c>=0xa&&_0x3c581c<=0x32)return'extract-function';else{if(_0x3c581c>0x32)return'extract-class';else return _0x3c581c<0xa?'extract-constant-or-utility':'extract-function';}}}}['determinePriority'](_0x53dbcd){const _0x164969=a0_0x23c83a,{impactScore:_0x4355c8}=_0x53dbcd;if(_0x4355c8>=0x8)return _0x164969(0x22d);if(_0x4355c8>=0x5)return _0x164969(0x1f5);return _0x164969(0x200);}[a0_0x23c83a(0x1f3)](_0x1ad095){const _0x2d32ca=a0_0x23c83a,_0x571a4d=_0x1ad095['blocks']['map'](_0x455342=>_0x455342[_0x2d32ca(0x215)])[_0x2d32ca(0x223)]('\x20'),_0x4f7264=_0x571a4d[_0x2d32ca(0x207)](/[a-zA-Z_$][a-zA-Z0-9_$]*/g)||[],_0x33e87c={};_0x4f7264['forEach'](_0x3dba69=>{const _0x52b91f=_0x2d32ca;if(['const','let','var','function',_0x52b91f(0x22b),'if',_0x52b91f(0x208),'for',_0x52b91f(0x22f)][_0x52b91f(0x232)](_0x3dba69))return;_0x33e87c[_0x3dba69]=(_0x33e87c[_0x3dba69]||0x0)+0x1;});const _0x144e64=Object['entries'](_0x33e87c)['sort']((_0x169158,_0x3126b8)=>_0x3126b8[0x1]-_0x169158[0x1])['slice'](0x0,0x3);if(_0x144e64['length']>0x0){const _0xd4ce52=_0x144e64[_0x2d32ca(0x205)](([_0x406738])=>_0x406738);return this[_0x2d32ca(0x234)](_0xd4ce52);}return _0x2d32ca(0x203);}[a0_0x23c83a(0x234)](_0x3a28d9){const _0x1f4abe=a0_0x23c83a;if(_0x3a28d9['length']===0x0)return'extractedFunction';return _0x3a28d9[0x0]+_0x3a28d9['slice'](0x1)[_0x1f4abe(0x205)](_0x45b8d5=>_0x45b8d5['charAt'](0x0)[_0x1f4abe(0x220)]()+_0x45b8d5['slice'](0x1))[_0x1f4abe(0x223)]('');}[a0_0x23c83a(0x22e)](_0x218f4b,_0x1ee55c,_0x4a74bb){const _0x2feb1e=a0_0x23c83a,{instanceCount:_0x561df4,duplicatedLines:_0x3a597d,filesCovered:_0x16b103}=_0x1ee55c;let _0x5f3fe7=_0x2feb1e(0x209)+_0x218f4b['type']+'\x20code\x20pattern\x20appears\x20'+_0x561df4+'\x20times';return _0x16b103>0x1&&(_0x5f3fe7+=_0x2feb1e(0x1fb)+_0x16b103+'\x20different\x20files'),_0x5f3fe7+=',\x20resulting\x20in\x20'+_0x3a597d+_0x2feb1e(0x236),_0x5f3fe7+='Refactoring\x20to\x20'+_0x4a74bb[_0x2feb1e(0x20b)](/-/g,'\x20')+'\x20would\x20improve\x20maintainability',_0x561df4>=0x3&&(_0x5f3fe7+=', reduce bugs from inconsistent changes'),_0x5f3fe7+=',\x20and\x20reduce\x20code\x20size',_0x1ee55c['impactScore']>=0x8&&(_0x5f3fe7+='.\x20This\x20is\x20a\x20high-impact\x20refactoring\x20opportunity'),_0x5f3fe7+'.';}[a0_0x23c83a(0x222)](_0x348bc4,_0x181b63){const _0x3f8118=a0_0x23c83a,{lineCount:_0x14b719,instanceCount:_0x1581e4,filesCovered:_0x45ce93}=_0x348bc4;let _0x31458d=0x0;_0x31458d+=Math[_0x3f8118(0x224)](_0x14b719/0xa,0x5),_0x31458d+=_0x1581e4*0.5,_0x31458d+=_0x45ce93*0.5;if(_0x181b63===_0x3f8118(0x206))_0x31458d+=0x3;else{if(_0x181b63===_0x3f8118(0x227))_0x31458d+=0x2;else _0x181b63===_0x3f8118(0x216)&&(_0x31458d+=0x1);}if(_0x31458d<=0x3)return'low';if(_0x31458d<=0x7)return _0x3f8118(0x1f5);return'high';}[a0_0x23c83a(0x1f9)](_0x418251){const _0x28dc15=a0_0x23c83a,_0x2beeb0=[];return _0x2beeb0['push']('Eliminate\x20'+_0x418251['duplicatedLines']+'\x20duplicated\x20lines\x20of\x20code'),_0x2beeb0[_0x28dc15(0x238)]('Improve\x20maintainability\x20by\x20centralizing\x20logic\x20in\x20one\x20place'),_0x418251[_0x28dc15(0x204)]>=0x3&&_0x2beeb0['push']('Reduce\x20risk\x20of\x20inconsistent\x20changes\x20across\x20'+_0x418251['instanceCount']+_0x28dc15(0x1f8)),_0x418251[_0x28dc15(0x211)]>0x2&&_0x2beeb0['push']('Improve\x20code\x20organization\x20across\x20'+_0x418251[_0x28dc15(0x211)]+'\x20files'),_0x2beeb0[_0x28dc15(0x238)]('Make\x20future\x20changes\x20easier\x20and\x20less\x20error-prone'),_0x2beeb0;}[a0_0x23c83a(0x1fe)](_0x2ea3ad,_0x5df02a,_0x539e7f){const _0x15eddd=a0_0x23c83a,_0x54f7f5=[];switch(_0x2ea3ad){case _0x15eddd(0x216):_0x54f7f5[_0x15eddd(0x238)]('1.\x20Create\x20a\x20new\x20function\x20named\x20\x27'+_0x5df02a+'\x27'),_0x54f7f5['push'](_0x15eddd(0x21d)),_0x54f7f5[_0x15eddd(0x238)]('3. Identify parameters needed from the surrounding context'),_0x54f7f5[_0x15eddd(0x238)](_0x15eddd(0x213)),_0x54f7f5['push']('5.\x20Test\x20to\x20ensure\x20behavior\x20is\x20preserved');break;case'extract-class':_0x54f7f5[_0x15eddd(0x238)](_0x15eddd(0x219)),_0x54f7f5['push']('2.\x20Move\x20related\x20methods\x20and\x20properties\x20into\x20the\x20class'),_0x54f7f5['push']('3.\x20Update\x20all\x20instances\x20to\x20use\x20the\x20new\x20class'),_0x54f7f5[_0x15eddd(0x238)]('4.\x20Consider\x20dependency\x20injection\x20for\x20better\x20testability');break;case _0x15eddd(0x206):_0x54f7f5['push']('1.\x20Create\x20a\x20new\x20module/file\x20for\x20this\x20shared\x20functionality'),_0x54f7f5[_0x15eddd(0x238)]('2.\x20Move\x20the\x20duplicated\x20code\x20into\x20the\x20new\x20module'),_0x54f7f5[_0x15eddd(0x238)]('3.\x20Export\x20the\x20necessary\x20functions/classes'),_0x54f7f5['push']('4. Update all files to import from the new module'),_0x54f7f5['push'](_0x15eddd(0x20f));break;default:_0x54f7f5[_0x15eddd(0x238)](_0x15eddd(0x226)+_0x2ea3ad[_0x15eddd(0x20b)](/-/g,'\x20')),_0x54f7f5[_0x15eddd(0x238)](_0x15eddd(0x1fc)),_0x54f7f5['push']('3.\x20Test\x20thoroughly');}return _0x54f7f5;}[a0_0x23c83a(0x20d)](_0x1ac3df,_0x1dfa19=0xa){const _0x4dd366=a0_0x23c83a,_0x431c3a=_0x1ac3df['split']('\x0a');if(_0x431c3a['length']<=_0x1dfa19)return _0x1ac3df;return _0x431c3a[_0x4dd366(0x229)](0x0,_0x1dfa19)['join']('\x0a')+_0x4dd366(0x1f6);}['averageLineCount'](_0x4f265c){const _0x20dadf=a0_0x23c83a,_0x8830f1=_0x4f265c[_0x20dadf(0x20c)]((_0x541f30,_0x5177d6)=>_0x541f30+(_0x5177d6[_0x20dadf(0x1f4)]-_0x5177d6[_0x20dadf(0x235)]+0x1),0x0);return Math[_0x20dadf(0x22c)](_0x8830f1/_0x4f265c[_0x20dadf(0x20a)]);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x229772=a0_0x3c76;function a0_0x1e46(){const _0xb53b6d=['zMLSBa','mta4nLvLq0rnCa','y29UzMLN','ndHltMrbthu','Bwf4','nJKYnZqXr3LPDeX2','ignSB25LigDYB3vWCW','yxbWCM94Aw1HDgvmq1m','Bg9N','nJG0nZiXofPcyNHjyq','AgfZ','ChvZAa','mte5ndz4rKXIsw0','otCWody0zeHeBhfr','ywrK','yMXVy2TZ','mteYotbkwLzSvMm','mtHMDNv4ANO','zMLUzfnPBwLSyxjdBg9Uzxm','z3jVDxbcEuHHC2G','zw50CMLLCW','BwLUvg9Rzw5Z','otuYmdq1u3P6wM96','y2fSy3vSyxrLqMXVy2TtAw1PBgfYAxr5','C2XPy2u','mJa2odC0m01OBNfAsa','ignVzguGyMXVy2TZ','Bg9Uz2vZDenVBw1VBLn1yNnLCxvLBMnL','zxHHy3q','zMLSDgvY','CgfYC2vY','Dg9Rzw5Z','AgfZAa','BgvUz3rO','oda5q3jIywX4'];a0_0x1e46=function(){return _0xb53b6d;};return a0_0x1e46();}function a0_0x3c76(_0x2a9769,_0xeff401){_0x2a9769=_0x2a9769-0xcb;const _0x1e4673=a0_0x1e46();let _0x3c7672=_0x1e4673[_0x2a9769];if(a0_0x3c76['SmsQtX']===undefined){var _0x10aecf=function(_0x272194){const _0x41c407='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x34f527='',_0x55bd88='';for(let _0x5b7dd5=0x0,_0x2ce495,_0x478469,_0x3d5c78=0x0;_0x478469=_0x272194['charAt'](_0x3d5c78++);~_0x478469&&(_0x2ce495=_0x5b7dd5%0x4?_0x2ce495*0x40+_0x478469:_0x478469,_0x5b7dd5++%0x4)?_0x34f527+=String['fromCharCode'](0xff&_0x2ce495>>(-0x2*_0x5b7dd5&0x6)):0x0){_0x478469=_0x41c407['indexOf'](_0x478469);}for(let _0x1ef46a=0x0,_0x4e41ce=_0x34f527['length'];_0x1ef46a<_0x4e41ce;_0x1ef46a++){_0x55bd88+='%'+('00'+_0x34f527['charCodeAt'](_0x1ef46a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x55bd88);};a0_0x3c76['bZUDrY']=_0x10aecf,a0_0x3c76['Nxpwvo']={},a0_0x3c76['SmsQtX']=!![];}const _0x92c68f=_0x1e4673[0x0],_0xda9ee=_0x2a9769+_0x92c68f,_0x2b6c02=a0_0x3c76['Nxpwvo'][_0xda9ee];return!_0x2b6c02?(_0x3c7672=a0_0x3c76['bZUDrY'](_0x3c7672),a0_0x3c76['Nxpwvo'][_0xda9ee]=_0x3c7672):_0x3c7672=_0x2b6c02,_0x3c7672;}(function(_0x51f98d,_0x584388){const _0x1e57c2=a0_0x3c76,_0x3e9c80=_0x51f98d();while(!![]){try{const _0x16dfb2=-parseInt(_0x1e57c2(0xd7))/0x1*(-parseInt(_0x1e57c2(0xd9))/0x2)+-parseInt(_0x1e57c2(0xce))/0x3+parseInt(_0x1e57c2(0xe5))/0x4+-parseInt(_0x1e57c2(0xcb))/0x5*(-parseInt(_0x1e57c2(0xe9))/0x6)+-parseInt(_0x1e57c2(0xdd))/0x7*(parseInt(_0x1e57c2(0xdb))/0x8)+-parseInt(_0x1e57c2(0xe1))/0x9+-parseInt(_0x1e57c2(0xe8))/0xa*(-parseInt(_0x1e57c2(0xe4))/0xb);if(_0x16dfb2===_0x584388)break;else _0x3e9c80['push'](_0x3e9c80['shift']());}catch(_0x4e4934){_0x3e9c80['push'](_0x3e9c80['shift']());}}}(a0_0x1e46,0x6a3db));export class CloneDetector{constructor(_0x34f527,_0x55bd88){const _0x91a5fe=a0_0x3c76;this[_0x91a5fe(0xda)]=_0x34f527,this[_0x91a5fe(0xd3)]=_0x55bd88;}['detectClones'](_0x5b7dd5){const _0x4414ba=a0_0x3c76;console[_0x4414ba(0xe0)]('Detecting\x20clones...');const _0x2ce495=[],_0x478469=[];for(const _0x4e41ce of _0x5b7dd5){_0x478469[_0x4414ba(0xe3)](..._0x4e41ce[_0x4414ba(0xe7)]);}console[_0x4414ba(0xe0)]('Analyzing\x20'+_0x478469[_0x4414ba(0xd6)]+_0x4414ba(0xcf));const _0x3d5c78=this['groupByHash'](_0x478469);for(const [_0x5d0b2a,_0x4e5631]of Object[_0x4414ba(0xec)](_0x3d5c78)){_0x4e5631[_0x4414ba(0xd6)]>0x1&&_0x2ce495[_0x4414ba(0xe3)]({'type':_0x4414ba(0xd1),'confidence':0x1,'blocks':_0x4e5631,'tokenCount':_0x4e5631[0x0]['tokens'][_0x4414ba(0xd6)]});}const _0x1ef46a=this[_0x4414ba(0xea)](_0x478469);return _0x2ce495[_0x4414ba(0xe3)](..._0x1ef46a),console[_0x4414ba(0xe0)]('Found\x20'+_0x2ce495[_0x4414ba(0xd6)]+_0x4414ba(0xde)),_0x2ce495;}[a0_0x229772(0xeb)](_0x26bcd2){const _0x92e4e5=a0_0x229772,_0x2aaed6={};for(const _0x188f1b of _0x26bcd2){if(_0x188f1b['tokens']['length']<this['config'][_0x92e4e5(0xed)])continue;!_0x2aaed6[_0x188f1b[_0x92e4e5(0xd5)]]&&(_0x2aaed6[_0x188f1b['hash']]=[]),_0x2aaed6[_0x188f1b[_0x92e4e5(0xd5)]][_0x92e4e5(0xe3)](_0x188f1b);}return _0x2aaed6;}['findSimilarClones'](_0x4d4130){const _0xb04462=a0_0x229772,_0x10a8cb=[],processed=new Set(),_0x2efbd1=_0x4d4130[_0xb04462(0xd2)](_0x32f1ef=>_0x32f1ef[_0xb04462(0xd4)]['length']>=this['config']['minTokens']);for(let _0x392afd=0x0;_0x392afd<_0x2efbd1[_0xb04462(0xd6)];_0x392afd++){const _0x24c8b5=_0x2efbd1[_0x392afd],_0x374379=[_0x24c8b5];if(processed['has'](_0x24c8b5['id']))continue;for(let _0x1ad3e5=_0x392afd+0x1;_0x1ad3e5<_0x2efbd1['length'];_0x1ad3e5++){const _0x205f92=_0x2efbd1[_0x1ad3e5];if(processed[_0xb04462(0xe2)](_0x205f92['id']))continue;if(_0x24c8b5[_0xb04462(0xd5)]===_0x205f92['hash'])continue;const _0xdc884e=this[_0xb04462(0xcc)](_0x24c8b5,_0x205f92);_0xdc884e>=this[_0xb04462(0xda)]['similarityThreshold']&&(_0x374379[_0xb04462(0xe3)](_0x205f92),processed[_0xb04462(0xe6)](_0x205f92['id']));}_0x374379[_0xb04462(0xd6)]>0x1&&(processed['add'](_0x24c8b5['id']),_0x10a8cb[_0xb04462(0xe3)]({'type':'similar','confidence':this['calculateGroupConfidence'](_0x374379),'blocks':_0x374379,'tokenCount':Math['max'](..._0x374379['map'](_0xb67b4=>_0xb67b4['tokens']['length']))}));}return _0x10a8cb;}['calculateBlockSimilarity'](_0x10cd1d,_0xc3e668){const _0x20e73a=a0_0x229772,_0x2e10c4=_0x10cd1d['tokens'],_0x590133=_0xc3e668['tokens'],_0x3f4c65=Math['min'](_0x2e10c4['length'],_0x590133['length'])/Math['max'](_0x2e10c4['length'],_0x590133[_0x20e73a(0xd6)]);if(_0x3f4c65<0.7)return 0x0;const _0x2b2e76=this[_0x20e73a(0xd0)](_0x2e10c4,_0x590133),_0x42565c=0x2*_0x2b2e76/(_0x2e10c4[_0x20e73a(0xd6)]+_0x590133['length']);return _0x42565c;}[a0_0x229772(0xd0)](_0x522531,_0x1f236e){const _0x4a00f7=a0_0x229772,_0x367b66=_0x522531['length'],_0x941e81=_0x1f236e['length'];if(_0x367b66*_0x941e81>0x186a0)return this['approximateLCS'](_0x522531,_0x1f236e);const _0x125acc=Array(_0x367b66+0x1)[_0x4a00f7(0xd8)](0x0)['map'](()=>Array(_0x941e81+0x1)[_0x4a00f7(0xd8)](0x0));for(let _0x2d33fe=0x1;_0x2d33fe<=_0x367b66;_0x2d33fe++){for(let _0x50abdd=0x1;_0x50abdd<=_0x941e81;_0x50abdd++){_0x522531[_0x2d33fe-0x1]===_0x1f236e[_0x50abdd-0x1]?_0x125acc[_0x2d33fe][_0x50abdd]=_0x125acc[_0x2d33fe-0x1][_0x50abdd-0x1]+0x1:_0x125acc[_0x2d33fe][_0x50abdd]=Math[_0x4a00f7(0xdc)](_0x125acc[_0x2d33fe-0x1][_0x50abdd],_0x125acc[_0x2d33fe][_0x50abdd-0x1]);}}return _0x125acc[_0x367b66][_0x941e81];}[a0_0x229772(0xdf)](_0x1277e2,_0x28e04f){const _0x42a05f=a0_0x229772,_0x1a9751=0x64;let _0x19c31f=0x0;for(let _0x27f95d=0x0;_0x27f95d<_0x1277e2[_0x42a05f(0xd6)];_0x27f95d+=_0x1a9751){const _0x544c20=_0x1277e2[_0x42a05f(0xcd)](_0x27f95d,_0x27f95d+_0x1a9751),_0x392f15=new Set(_0x28e04f['slice'](Math[_0x42a05f(0xdc)](0x0,_0x27f95d-_0x1a9751),_0x27f95d+_0x1a9751*0x2));_0x19c31f+=_0x544c20[_0x42a05f(0xd2)](_0x3f44be=>_0x392f15[_0x42a05f(0xe2)](_0x3f44be))[_0x42a05f(0xd6)];}return _0x19c31f;}['calculateGroupConfidence'](_0x246390){const _0x445872=a0_0x229772;if(_0x246390[_0x445872(0xd6)]===0x0)return 0x0;let _0x11e624=0x0,_0x459832=0x0;for(let _0xc9d5fc=0x0;_0xc9d5fc<_0x246390['length'];_0xc9d5fc++){for(let _0x559174=_0xc9d5fc+0x1;_0x559174<_0x246390[_0x445872(0xd6)];_0x559174++){_0x11e624+=this['calculateBlockSimilarity'](_0x246390[_0xc9d5fc],_0x246390[_0x559174]),_0x459832++;}}return _0x459832>0x0?_0x11e624/_0x459832:0x0;}}
|