appbaseio/dejaVu

View on GitHub

Showing 81 of 198 total issues

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        const { mode } = this.props;

        return (
            <Select
Severity: Minor
Found in packages/browser/src/components/DataBrowser/ModeSwitch.js - About 1 hr to fix

    Function getNestedArrayField has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const getNestedArrayField = (data, mappings) => {
        const fieldsToBeDeleted = {};
        const parentFields = {};
        const indexTypeMap = {};
        data.forEach(dataItem => {
    Severity: Minor
    Found in packages/browser/src/utils/mappings.js - About 1 hr to fix

      Function openApp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const openApp = async (rawUrl, indexName) => {
          const defaultError = 'Unable to get version';
          try {
              const { url } = parseUrl(rawUrl);
              const headers = getHeaders(rawUrl);
      Severity: Minor
      Found in packages/browser/src/apis/analyzers.js - About 55 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 putSettings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const putSettings = async (rawUrl, indexName) => {
          const defaultError = 'Unable to get version';
          try {
              const { url } = parseUrl(rawUrl);
              const headers = getHeaders(rawUrl);
      Severity: Minor
      Found in packages/browser/src/apis/analyzers.js - About 55 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 addMapping has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const addMapping = async (
          indexName,
          typeName,
          rawUrl,
          field,
      Severity: Minor
      Found in packages/browser/src/apis/mappings.js - About 55 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 TextCell has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const TextCell = ({
          children,
          onChange,
          mode,
          shouldAutoFocus,
      Severity: Minor
      Found in packages/browser/src/components/Cell/TextCell.js - About 55 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 fetchMappings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const fetchMappings = async (appname, rawUrl) => {
          const defaultError = 'Unable to fetch mappings';
          try {
              const { url } = parseUrl(rawUrl);
              const headers = getHeaders(rawUrl);
      Severity: Minor
      Found in packages/browser/src/apis/mappings.js - About 55 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 closeApp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export const closeApp = async (rawUrl, indexName) => {
          const defaultError = 'Unable to get version';
          try {
              const { url } = parseUrl(rawUrl);
              const headers = getHeaders(rawUrl);
      Severity: Minor
      Found in packages/browser/src/apis/analyzers.js - About 55 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 {
                  url: rawUrl,
                  isLoading,
                  mappings,
      Severity: Minor
      Found in packages/browser/src/components/DataBrowser/DataBrowser.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 flatten has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export const flatten = data => {
          const result = {};
      
          function recurse(cur, prop = '') {
              if (Object(cur) !== cur) {
      Severity: Minor
      Found in packages/browser/src/utils/exportData.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 getURL has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export const getURL = () => {
          let url = localStorage.getItem('url') || sessionStorage.getItem('url');
          const params = new URLSearchParams(window.location.search);
          if (!url || url === 'undefined') {
              url = params.has('url') ? params.get('url') : 'null';
      Severity: Minor
      Found in packages/dejavu-main/app/src/constants/config.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 Navigation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      const Navigation = ({ indexes, isConnected, history }: Props) => {
          const [selectedKey, setSelectedKey] = useState('browse');
      
          useEffect(() => {
              const routeName = window.location.pathname.substring(1);
      Severity: Minor
      Found in packages/dejavu-main/app/src/components/Navigation.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 searchAfter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export const searchAfter = async (
          app,
          types,
          url,
          version,
      Severity: Minor
      Found in packages/browser/src/utils/exportData.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 render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          render() {
              const {
                  mappings,
                  appname,
                  sortField,
      Severity: Minor
      Found in packages/browser/src/components/DataTable/ColumnHeader.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 getURL has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export const getURL = () => {
          let url = localStorage.getItem('url') || sessionStorage.getItem('url');
          const params = new URLSearchParams(window.location.search);
          if (!url || url === 'undefined') {
              url = params.has('url') ? params.get('url') : 'null';
      Severity: Minor
      Found in packages/browser/src/constants/config.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 (
                      !addColumnError &&
                      addColumnField &&
                      selectedIndex &&
                      selectedType &&
      Severity: Major
      Found in packages/browser/src/components/DataBrowser/AddFieldModal.js - About 40 mins to fix

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

        const getSearchAfterData = async (
            app,
            types,
            url,
            version,
        Severity: Minor
        Found in packages/browser/src/utils/exportData.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 search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const search = async (app, type, rawUrl, version, fetchData) => {
            const defaultError = 'Unable to get count';
            try {
                const { url } = parseUrl(rawUrl);
                const headers = getHeaders(rawUrl);
        Severity: Minor
        Found in packages/browser/src/apis/search.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 addData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export const addData = async (
            indexName,
            typeName,
            docId,
            rawUrl,
        Severity: Minor
        Found in packages/browser/src/apis/data.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

        Avoid too many return statements within this function.
        Open

                        return <TextCell {...props} key={`${column}-${row}`} />;
        Severity: Major
        Found in packages/browser/src/components/Cell/Cell.js - About 30 mins to fix
          Severity
          Category
          Status
          Source
          Language