crane-cloud/frontend

View on GitHub

Showing 404 of 404 total issues

Function ProjectLogs has a Cognitive Complexity of 158 (exceeds 5 allowed). Consider refactoring.
Open

const ProjectLogs = (props) => {
  const [loading, setLoading] = useState(false);
  const [logs, setLogs] = useState([]);
  const [feedback, setFeedback] = useState("");
  const { data } = useSelector((state) => state.user);
Severity: Minor
Found in src/pages/ProjectLogs/index.jsx - About 3 days to fix

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 UserActivity has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
Open

const UserActivity = () => {
  // const { data } = useSelector((state) => state.user);

  const user = useSelector((state) => state.user);
  const [currentPage, handleChangePage] = usePaginator();
Severity: Minor
Found in src/pages/UserActivity/index.js - About 1 day to fix

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 AdminLogsPage has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
Open

const AdminLogsPage = () => {
  const clusterID = localStorage.getItem("clusterID");

  const baseLink = "/users/activities?";
  const [loading, setLoading] = useState(false);
Severity: Minor
Found in src/pages/AdminLogsPage/index.js - About 1 day to fix

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 ProjectBillingPage has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
Open

const ProjectBillingPage = (props) => {
  const { data } = useSelector((state) => state.user);
  const { projectID } = useParams();
  const dispatch = useDispatch();

Severity: Minor
Found in src/components/ProjectBillingPage/index.jsx - About 1 day to fix

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 ProjectBillingPage has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
Open

const ProjectBillingPage = (props) => {
  const { data } = useSelector((state) => state.user);
  const { projectID } = useParams();
  const dispatch = useDispatch();

Severity: Minor
Found in src/pages/ProjectBillingPage/index.jsx - About 1 day to fix

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 ActivityLogs has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
Open

const ActivityLogs = ({ projectID }) => {
  const [toTS, setToTS] = useState("none");
  const [fromTS, setFromTS] = useState("none");
  const [showStatusFilter, setShowStatusFilter] = useState(false);
  const [filterOpen, setFilterOpen] = useState(false);
Severity: Minor
Found in src/components/ActivityLogs/index.jsx - About 1 day to fix

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 AdminProjectsOverview has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
Open

const AdminProjectsOverview = () => {
  const [currentPage, handleChangePage] = usePaginator();
  const dispatch = useDispatch();
  const [word, setWord] = useState("");
  const [feedback, setFeedback] = useState("");
Severity: Minor
Found in src/components/ProjectListing/ProjectList.js - About 1 day to fix

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 AppSettingsPage has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

const AppSettingsPage = () => {
  const dispatch = useDispatch();
  const history = useHistory();
  const { appID } = useParams();

Severity: Minor
Found in src/pages/AppSettingsPage/index.jsx - About 1 day to fix

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 handleSubmit has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

  handleSubmit() {
    const {
      projectName,
      projectDescription,
      projectOrganisation,
Severity: Minor
Found in src/pages/ProjectSettingsPage/index.jsx - About 1 day to fix

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 AdminProjectOverviewPage has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

const AdminProjectOverviewPage = () => {
  const history = useHistory();
  const { clusterID } = useParams();
  const [projects, setProjects] = useState([]);
  const [feedback, setFeedback] = useState("");
Severity: Minor
Found in src/pages/AdminProjectOverviewPage/index.jsx - About 7 hrs to fix

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 render has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const { projects } = this.props;
    const { projectID, databaseID } = this.props.match.params;
    // const dbInfo = this.getDatabaseInfo(databaseID);
    const {
Severity: Minor
Found in src/pages/DBSettingsPage/index.jsx - About 7 hrs to fix

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 AdminProjectDetails has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

const AdminProjectDetails = () => {
  const clusterID = localStorage.getItem("clusterID");
  const clusterName = localStorage.getItem("clusterName");
  const location = useLocation();
  const isOverviewProject = location.pathname.includes("/projects-overview");
Severity: Minor
Found in src/components/AdminProjectDetails/index.js - About 6 hrs to fix

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

ProjectSettingsPage has 43 functions (exceeds 20 allowed). Consider refactoring.
Open

class ProjectSettingsPage extends React.Component {
  constructor(props) {
    super(props);
    const projectInfo = { ...JSON.parse(localStorage.getItem("project")) };
    const { name, description, organisation, project_type, age } = projectInfo;
Severity: Minor
Found in src/pages/ProjectSettingsPage/index.jsx - About 5 hrs to fix

    Function InformationBar has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    const InformationBar = ({
      header,
      buttontext,
      status,
      showBtn,
    Severity: Minor
    Found in src/components/InformationBar/index.js - About 5 hrs to fix

    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

    CreateApp has 37 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class CreateApp extends React.Component {
      constructor(props) {
        super(props);
    
        const {
    Severity: Minor
    Found in src/components/CreateApp/index.js - About 4 hrs to fix

      Function render has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

        render() {
          const {
            match: { params },
            isDeleted,
            isUpdated,
      Severity: Minor
      Found in src/pages/ProjectSettingsPage/index.jsx - About 4 hrs to fix

      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 AdminDBList has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

      const AdminDBList = () => {
        const history = useHistory();
        const [currentPage, handleChangePage] = usePaginator();
        const [databaseSummary, setDatabaseSummary] = useState([]);
        const [feedback, setFeedback] = useState("");
      Severity: Minor
      Found in src/components/AdminDB/index.jsx - About 4 hrs to fix

      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 handleSubmit has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

        handleSubmit() {
          const {
            name,
            uri,
            envVars,
      Severity: Minor
      Found in src/components/CreateApp/index.js - About 4 hrs to fix

      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

      DBSettingsPage has 32 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class DBSettingsPage extends React.Component {
        constructor(props) {
          super(props);
      
          this.state = {
      Severity: Minor
      Found in src/pages/DBSettingsPage/index.jsx - About 4 hrs to fix

        Function render has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

          render() {
            const {
              users,
              isFetched,
              isFetching,
        Severity: Minor
        Found in src/components/AdminUsersProfile/index.js - About 3 hrs to fix

        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

        Severity
        Category
        Status
        Source
        Language