crane-cloud/frontend

View on GitHub

Showing 81 of 404 total issues

Function AdminAppDetail has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

const AdminAppDetail = () => {
  const dispatch = useDispatch();
  const { appID } = useParams();
  const [appDetail, setAppDetail] = useState({});

Severity: Minor
Found in src/pages/AdminAppDetail/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

Function NewHeader has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

const NewHeader = (props) => {
  const [hidden, setHidden] = useState(false);
  const [open, setOpen] = useState(false);
  const dropdownRef = useRef(null);
  const { match } = props;
Severity: Minor
Found in src/components/NewHeader/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

Function SideBar has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

const SideBar = (props) => {
  const { name } = props;
  const params = useParams();
  const { projectID, appID } = params;
  const location = useLocation();
Severity: Minor
Found in src/components/SideBar/index.jsx - 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

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

  render() {
    const {
      openCreateComponent,
      Searchword,
      // SearchList,
Severity: Minor
Found in src/pages/UserProjectsPage/index.jsx - 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

Function DisableModalContent has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

const DisableModalContent = ({
  item,
  disableProgress,
  handleDisableButtonClick,
  hideDisableAlert,
Severity: Minor
Found in src/components/DisableModalContent/index.jsx - About 2 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

AdminUserPage has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class AdminUserPage extends Component {
  constructor() {
    super();
    this.state = {
      actionsMenu: false,
Severity: Minor
Found in src/components/AdminUsersProfile/index.js - About 2 hrs to fix

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

      render() {
        const { params } = this.props.match;
        const { projectID, appID } = params;
        // eslint-disable-next-line no-unused-vars
        const { isReverting, isReverted } = this.props;
    Severity: Minor
    Found in src/pages/AppMetricsPage/index.jsx - About 2 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 getUsersList has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

      (dateRange, sectionValue, page, keywords) => async (dispatch) => {
        dispatch(startGettingUsers());
    
        let link;
        if (sectionValue !== "all") {
    Severity: Minor
    Found in src/redux/actions/users.js - About 2 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 ClusterPage has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    const ClusterPage = ({
      creatingCluster,
      isAdded,
      isFailed,
      addCluster,
    Severity: Minor
    Found in src/pages/ClusterPage/index.jsx - About 2 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 DateInput has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    const DateInput = ({
      handleChange,
      position,
      label,
      showCalendar,
    Severity: Minor
    Found in src/components/DateInput/index.jsx - About 2 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 AdminUserOverviewPage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    const AdminUserOverviewPage = () => {
      const [usersSummary, setUsersSummary] = useState([]);
      const [feedback, setFeedback] = useState("");
      const [loading, setLoading] = useState(false);
      const [period, setPeriod] = useState("all");
    Severity: Minor
    Found in src/pages/AdminUserOverviewPage/index.jsx - About 2 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 16 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const {
          name,
          description,
          cardID,
    Severity: Minor
    Found in src/components/ProjectCard/index.js - About 2 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 15 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const {
          match: { params },
          databases,
          isFetchingDatabases,
    Severity: Minor
    Found in src/components/DatabaseList/index.jsx - About 1 hr 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 handlePeriodChange has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

      async handlePeriodChange(period, customTime = null) {
        let days;
        let step;
        let startTimeStamp;
        let endTimeStamp = getCurrentTimeStamp();
    Severity: Minor
    Found in src/pages/ProjectMemoryPage/index.jsx - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const {
          name,
          email,
          password,
    Severity: Minor
    Found in src/pages/RegisterPage/index.js - About 1 hr 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 handlePeriodChange has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

      async handlePeriodChange(period, customTime = null) {
        let days;
        let step;
        let startTimeStamp;
        let endTimeStamp = getCurrentTimeStamp();
    Severity: Minor
    Found in src/pages/ProjectNetworkPage/index.jsx - About 1 hr 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 UserAccounts has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    const UserAccounts = () => {
      const [currentPage, handleChangePage] = usePaginator();
    
      const [actionsMenu, setActionsMenu] = useState(false);
      const [betaUserModal, setBetaUserModal] = useState(false);
    Severity: Minor
    Found in src/components/UserAccounts/index.js - About 1 hr 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 handlePeriodChange has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

      async handlePeriodChange(period, customTime = null) {
        
    let days;
        let step;
        let startTimeStamp;
    Severity: Minor
    Found in src/pages/ProjectCPUPage/index.jsx - About 1 hr 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 DomainAndUrlsTab has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    const DomainAndUrlsTab = ({
      app,
      updating,
      reverting,
      urlOnClick,
    Severity: Minor
    Found in src/components/DomainAndUrlsTab/index.jsx - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const {
          username,
          passwordModel,
          updateModal,
    Severity: Minor
    Found in src/components/UserProfile/index.js - About 1 hr 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