Showing 99 of 451 total issues
Function ClientDetails
has 322 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ClientDetails = () => {
const { clientId } = useParams();
const navigate = useNavigate();
const [client] = useFetch(`/clients/${clientId}`);
- Create a ticketCreate a ticket
Function TaskDetails
has 264 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TaskDetails = () => {
const { user: loggedInUser } = useAuth();
const navigate = useNavigate();
const { taskId } = useParams();
const [task, fetchTask] = useFetch(`/tasks/${taskId}`);
- Create a ticketCreate a ticket
Function OrganisationForm
has 244 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const OrganisationForm = () => {
const [organisation, setOrganisation] = useState(Organisation);
const [rootOrganisation, refetchOrganisation] = useFetch(
"/organisations/root",
- Create a ticketCreate a ticket
File Form.jsx
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
Accordion,
AccordionButton,
AccordionIcon,
AccordionItem,
- Create a ticketCreate a ticket
Function CommandDetails
has 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const CommandDetails = () => {
const { commandId } = useParams();
const navigate = useNavigate();
const [command] = useFetch(`/commands/${commandId}`);
- Create a ticketCreate a ticket
File OwaspRR.jsx
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Input } from '@chakra-ui/react';
import { useState } from 'react';
import Select from "react-select";
import { PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart } from 'recharts';
- Create a ticketCreate a ticket
Function VulnerabilityForm
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
Open
const VulnerabilityForm = ({
isEditForm = false,
vulnerability,
vulnerabilitySetter: setVulnerability,
onFormSubmit,
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function VulnerabilityDetails
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VulnerabilityDetails = () => {
const navigate = useNavigate();
const { vulnerabilityId } = useParams();
const [vulnerability, updateVulnerability] = useFetch(
`/vulnerabilities/${vulnerabilityId}`,
- Create a ticketCreate a ticket
Function VulnerabilitiesList
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VulnerabilitiesList = () => {
const navigate = useNavigate();
const query = useQuery();
let pageNumber = query.get("page");
pageNumber = pageNumber !== null ? parseInt(pageNumber) : 1;
- Create a ticketCreate a ticket
Function VulnerabilityTemplatesList
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VulnerabilityTemplatesList = () => {
const navigate = useNavigate();
const [sortBy, setSortBy] = useState({
column: "insert_ts",
order: "DESC",
- Create a ticketCreate a ticket
File Details.jsx
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
Button,
ButtonGroup,
Tab,
TabList,
- Create a ticketCreate a ticket
Function UsersList
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UsersList = () => {
const navigate = useNavigate();
const { user: loggedInUser } = useContext(AuthContext);
const [users, updateUsers] = useFetch("/users");
const deleteUser = useDelete("/users/", updateUsers);
- Create a ticketCreate a ticket
Function SendReport
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SendReport = () => {
const navigate = useNavigate();
const { projectId } = useParams();
const [project] = useFetch(`/projects/${projectId}`);
const [revisions] = useFetch(`/reports?projectId=${projectId}`);
- Create a ticketCreate a ticket
Function UserPreferences
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UserPreferences = () => {
const { i18n } = useTranslation();
const { user } = useAuth();
- Create a ticketCreate a ticket
Function VaultItemEdit
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const VaultItemEdit = () => {
const { projectId, vaultItemId } = useParams();
const navigate = useNavigate();
const [item, setVaultItem] = useState({ ...Vault });
- Create a ticketCreate a ticket
Function OwaspRR
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
const OwaspRR = ({
vulnerability,
vulnerabilitySetter: setVulnerability
}) => {
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function TemplatesList
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TemplatesList = () => {
const navigate = useNavigate();
const [templates, updateTemplates] = useFetch("/projects?isTemplate=1");
const cloneProject = (ev, templateId) => {
- Create a ticketCreate a ticket
Function ReportTemplatesList
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ReportTemplatesList = () => {
const [templates, refetchTemplates] = useFetch('/reports/templates')
const destroy = useDelete('/reports/', refetchTemplates);
- Create a ticketCreate a ticket
Function TasksList
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const TasksList = () => {
const navigate = useNavigate();
const [tableModel, setTableModel] = useState(new TaskTableModel(true, true))
- Create a ticketCreate a ticket
Function ProjectMembership
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ProjectMembership = () => {
const { projectId } = useParams();
const [users] = useFetch(`/users`)
const [members, updateMembers] = useFetch(`/projects/${projectId}/users`)
const [savedProject] = useFetch(`/projects/${projectId}`);
- Create a ticketCreate a ticket