-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 7.08 KB
/
.eslintcache
1
[{"/root/Desktop/pyproj/nwhacks/demo_extension/src/index.js":"1","/root/Desktop/pyproj/nwhacks/demo_extension/src/App.js":"2","/root/Desktop/pyproj/nwhacks/demo_extension/src/reportWebVitals.js":"3"},{"size":500,"mtime":1610228489739,"results":"4","hashOfConfig":"5"},{"size":3666,"mtime":1610302580471,"results":"6","hashOfConfig":"5"},{"size":362,"mtime":1610228490071,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"10"},"16jra19",{"filePath":"11","messages":"12","errorCount":0,"warningCount":9,"fixableErrorCount":0,"fixableWarningCount":0,"source":"13","usedDeprecatedRules":"10"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"16"},"/root/Desktop/pyproj/nwhacks/demo_extension/src/index.js",[],["17","18"],"/root/Desktop/pyproj/nwhacks/demo_extension/src/App.js",["19","20","21","22","23","24","25","26","27"],"/*global chrome*/\nimport './App.css';\nimport { useState,useEffect,useCallback } from 'react';\nimport React from 'react';\nimport { createGlobalState } from 'react-hooks-global-state';\n\nconst initialState = { sentiment: 0 , sentence: '' };\nconst { setGlobalState,useGlobalState } = createGlobalState(initialState);\n\n//get what user is typing\nvar user_typed = ''\ndocument.addEventListener('keypress', function(e){\n if(e.key=='Enter'){\n get_from_user_typed(user_typed);\n user_typed='';\n }\n else if(e.key==\" \"){\n user_typed += \" \";\n }\n else{\n user_typed += e.key;\n }\n console.log(user_typed,e);\n});\n\nasync function get_from_user_typed(user_input) {\n \n const handleResponse = (response) => {\n if (response.error) {\n setGlobalState('sentiment',response.error);\n console.log(response.error);\n } else {\n console.log(response.sentiment_score);\n setGlobalState('sentiment',response.sentiment_score);\n var op1=String(user_input)+\"\\n\"+String(response.sentiment_score);\n if (response.sentiment_score>=0){\n op1+=\"\\n The Text is Not Offensive\";\n }\n else{\n op1+=\"\\n Please change your Text,it is Offensive\";\n }\n alert(op1);\n }\n };\n console.log(user_input);\n chrome.runtime.sendMessage({message: user_input}, handleResponse);\n \n }\n\n \nfunction App() {\n\nconst [sentence, setSentence] = useGlobalState('sentence');\nconst [sentiment, setSentiment] = useGlobalState('sentiment');\n\n useEffect(() => {\n quickstart();\n }, []);\n\n const getList = useCallback(() => {\n quickstart();\n }, [sentiment,sentence]);\n\n const quickstart = () => {\n var allInputs = document.getElementsByTagName('body')[0].innerHTML;\n var stripedHtml = allInputs.replace(/<[^>]+>/g, '');\n console.log(1,stripedHtml);\n var sentence_list = stripedHtml.split(\".\");\n var sentiment_average=0;\n console.log(sentence_list);\n for (var i = 0; i < sentence_list.length; i++) {\n const handleResponse = (response) => {\n if (response.error) {\n setGlobalState('sentiment',response.error);\n } else {\n sentiment_average+=response.sentiment_score;\n }\n };\n \n chrome.runtime.sendMessage({message: sentence_list[i]}, handleResponse);\n }\n console.log(sentiment_average);\n setGlobalState('sentiment',sentiment_average);\n \n setGlobalState('sentence',\"Sentiment of Whole Website\");\n }\n return (\n <div>\n \n <div className=\"header\">\n <h1>BULLY-IN-SPECT</h1>\n <p>Extension to filter offensive speech</p>\n </div>\n <div className=\"contentBox\">\n <div className=\"pattern\">\n <p>To start inspecting offensive words/websites, <span className=\"resalted\">follow the steps</span>:</p>\n <p>1. Click on Extension and Start Typing and Once You are Finished Press Enter.It will give you the Results of Your Text</p>\n <p>2. Open Any Website any it will tell if it good to visit</p>\n <p> If Output is <span className=\"resalted1\">Negative (-1 to 0)Then Text/Site is Offensive</span></p>\n <p> If Output is <span className=\"resalted2\">Positive (0 to 1) Then Text/Site is Positive</span></p>\n <p> If Output is <span className=\"resalted3\">0 Then Text/Site is Neutral</span></p>\n <h3>Output</h3>\n <p>Sentence : {sentence} </p>\n <p>Sentiment : {sentiment}</p>\n </div>\n </div>\n <div className=\"footer\">\n <a href=\"https://github.com/aniketdhole07/BULLY-IN-SPECT\" target=\"_blank\"><p>By Katie,Bayan,Daniel,Aniket</p></a>\n </div>\n </div>\n );\n}\n\nexport default React.memo(App);\n","/root/Desktop/pyproj/nwhacks/demo_extension/src/reportWebVitals.js",[],["28","29"],{"ruleId":"30","replacedBy":"31"},{"ruleId":"32","replacedBy":"33"},{"ruleId":"34","severity":1,"message":"35","line":3,"column":10,"nodeType":"36","messageId":"37","endLine":3,"endColumn":18},{"ruleId":"38","severity":1,"message":"39","line":13,"column":11,"nodeType":"40","messageId":"41","endLine":13,"endColumn":13},{"ruleId":"38","severity":1,"message":"39","line":17,"column":16,"nodeType":"40","messageId":"41","endLine":17,"endColumn":18},{"ruleId":"34","severity":1,"message":"42","line":53,"column":18,"nodeType":"36","messageId":"37","endLine":53,"endColumn":29},{"ruleId":"34","severity":1,"message":"43","line":54,"column":19,"nodeType":"36","messageId":"37","endLine":54,"endColumn":31},{"ruleId":"34","severity":1,"message":"44","line":60,"column":9,"nodeType":"36","messageId":"37","endLine":60,"endColumn":16},{"ruleId":"45","severity":1,"message":"46","line":62,"column":6,"nodeType":"47","endLine":62,"endColumn":26,"suggestions":"48"},{"ruleId":"49","severity":1,"message":"50","line":72,"column":30,"nodeType":"51","messageId":"52","endLine":78,"endColumn":8},{"ruleId":"53","severity":1,"message":"54","line":108,"column":11,"nodeType":"55","endLine":108,"endColumn":85},{"ruleId":"30","replacedBy":"56"},{"ruleId":"32","replacedBy":"57"},"no-native-reassign",["58"],"no-negated-in-lhs",["59"],"no-unused-vars","'useState' is defined but never used.","Identifier","unusedVar","eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","'setSentence' is assigned a value but never used.","'setSentiment' is assigned a value but never used.","'getList' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useCallback has unnecessary dependencies: 'sentence' and 'sentiment'. Either exclude them or remove the dependency array.","ArrayExpression",["60"],"no-loop-func","Function declared in a loop contains unsafe references to variable(s) 'sentiment_average'.","ArrowFunctionExpression","unsafeRefs","react/jsx-no-target-blank","Using target=\"_blank\" without rel=\"noreferrer\" is a security risk: see https://html.spec.whatwg.org/multipage/links.html#link-type-noopener","JSXOpeningElement",["58"],["59"],"no-global-assign","no-unsafe-negation",{"desc":"61","fix":"62"},"Update the dependencies array to be: []",{"range":"63","text":"64"},[1568,1588],"[]"]