crane-cloud/frontend

View on GitHub

Showing 404 of 404 total issues

Function SpendingPeriod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const SpendingPeriod = (props) => {

 const [showModal, setShowModal] = useState(false);
 const [toTimeStamp, setToTimeStamp] = useState(0);
 const [fromTimeStamp, setFromTimeStamp] = useState(0);
Severity: Minor
Found in src/components/SpendingPeriod/index.js - About 45 mins 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 SideNav has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const SideNav = ({ clusterId, clusterName }) => {
  const BASE_URL = `/clusters/${clusterId}`;

  const isDesktop = useMedia();
  const [OpenForsmallScreen, setopenForsmallScreen] = useState(false);
Severity: Minor
Found in src/components/SideNav/index.jsx - About 45 mins 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 renderDays has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  renderDays(month, year) {
    const days = [];
    const weeks = [];
    let weekCount = 0;
    let dayCount = 0;
Severity: Minor
Found in src/components/Calendar/index.jsx - About 45 mins 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 PodsList has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const PodsList = () => {
  const { isRetrieving, pods, isFetched } = useSelector(
    (state) => state.podsReducer
  );

Severity: Minor
Found in src/components/PodsList/index.jsx - About 45 mins 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 Period has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const Period = (props) => {
  const [showModal, setShowModal] = useState(false);
  const [period, setPeriod] = useState("1d");
  const [showFromCalendar, setShowFromCalendar] = useState(true);
  const [showToCalendar, setShowToCalendar] = useState(false);
Severity: Minor
Found in src/components/Period/index.jsx - About 45 mins 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 AppsCard has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const AppsCard = (props) => {
  const { getAppMemory, name, appStatus, appId, otherData, appMemoryMetrics, url, disabled,
    admin_disabled=false } =
    props;
  const { projectID } = props.otherData;
Severity: Minor
Found in src/components/AppsCard/index.jsx - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      params: { projectID },
      data: { beta },
      clusters: { clusters },
Severity: Minor
Found in src/components/CreateApp/index.js - About 45 mins 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

Consider simplifying this complex logical expression.
Open

    if (
      !email ||
      !password ||
      !name ||
      !username ||
Severity: Major
Found in src/pages/RegisterPage/index.js - About 40 mins to fix

    Function UserListing has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    const UserListing = (props) => {
      let {
        sectionValue,
        isFetching,
        users,
    Severity: Minor
    Found in src/components/UserListing/index.jsx - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const {
          match: { params },
          isUpdating,
          isFailed,
    Severity: Minor
    Found in src/pages/ClusterSettingsPage/index.js - About 35 mins 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 GraphInput has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    const GraphInput = ({
      handleChange,
      position,
      label,
      showCalendar,
    Severity: Minor
    Found in src/components/GraphInput/index.jsx - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
    Open

      handleSubmit() {
        const { databaseFlavour, dbName, projectId } = this.state;
        const { createAdminDB } = this.props;
        if (!databaseFlavour) {
          this.setState({
    Severity: Minor
    Found in src/components/AdminDB/CreateAdminDB.jsx - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
    Open

      handleSubmit() {
        const { host, prometheus_url, costmodal_url, name, token, currentCluster } =
          this.state;
        const {
          match: {
    Severity: Minor
    Found in src/pages/ClusterSettingsPage/index.js - About 35 mins 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 componentDidUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      componentDidUpdate(prevProps, prevState) {
        const {
          isAdded,
          getClustersList,
          getUserProjects,
    Severity: Minor
    Found in src/pages/UserProjectsPage/index.jsx - About 35 mins 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 handleProjectValidation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    export const handleProjectValidation = (
      projectName,
      projectDescription,
      organisationType,
      organisation,
    Severity: Minor
    Found in src/helpers/validation.js - About 35 mins 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 ImageSettingsTab has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    const ImageSettingsTab = ({
      app,
      error,
      loading,
      newImage,
    Severity: Minor
    Found in src/components/ImageSettingsTab/index.jsx - About 35 mins 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 handleTypeSelectChange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      handleTypeSelectChange(selected) {
        const { othersBool } = this.state;
        if (selected.id === 6) {
          if (!othersBool) {
            this.setState({ othersBool: true });
    Severity: Minor
    Found in src/components/CreateProject/index.jsx - About 25 mins 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 DeploymentsPage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    const DeploymentsPage = () => {
      const dispatch = useDispatch();
      const clusterID = localStorage.getItem("clusterID");
      const [currentPage, handleChangePage] = usePaginator();
    
    
    Severity: Minor
    Found in src/pages/DeploymentsPage/index.js - About 25 mins 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 handleTypeSelectChange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      handleTypeSelectChange(selected) {
        const { othersBool } = this.state;
        if (selected.id === 6) {
          if (!othersBool) {
            this.setState({ othersBool: true });
    Severity: Minor
    Found in src/pages/ProjectSettingsPage/index.jsx - About 25 mins 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 LineChartComponent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    const LineChartComponent = ({
      preview,
      data,
      yLabel,
      xLabel,
    Severity: Minor
    Found in src/components/LineChart/index.jsx - About 25 mins 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