1.2.0 • Published 6 months ago

sast-scan v1.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

const CodeScanner = () => { const code, setCode = useState(''); const results, setResults = useState([]);

const handleScan = () => {
    let vulnerabilities = [];
    try {
        vulnerabilities = scanCode(code); // Scan the code
    } catch (error) {
        console.error(`Error scanning code: ${error.message}`);
    }
    setResults(vulnerabilities);
};

return (
    <div>
        <h1>Code Scanner</h1>
        <textarea
            value={code}
            onChange={(e) => setCode(e.target.value)}
            placeholder="Enter code to scan"
        />
        <button onClick={handleScan}>Scan Code</button>
        <div>
            {results.map((result, index) => (
                <div key={index}>
                    <p> <strong>Vulnerability:</strong> {result.message}</p>
                    <p> <strong>Fix:</strong> {result.fix}</p>
                    <p> <strong>Line Number:</strong> {result.lineNumber}</p>
                </div>
            ))}
        </div>
    </div>
);

};

export default CodeScanner;

Note: you can refer dev.to Article for more informatation

1.2.0

6 months ago

1.1.1

9 months ago

1.1.0

10 months ago

1.0.18

10 months ago

1.0.17

10 months ago

1.0.16

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago