appbaseio/dejaVu

View on GitHub

Showing 81 of 198 total issues

Function deleteData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const deleteData = async (
    rawUrl,
    indexName,
    typeName,
    queryData,
Severity: Minor
Found in packages/browser/src/apis/data.js - About 1 hr to fix

    Function handleFetchMappings has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    export function* handleFetchMappings() {
        const defaultError = 'Unable to get mappings';
        const defaultErrorDescription = 'Please add mappings';
        try {
            yield put(clearError());
    Severity: Minor
    Found in packages/browser/src/sagas/mappings.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 addData has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const addData = async (
        indexName,
        typeName,
        docId,
        rawUrl,
    Severity: Minor
    Found in packages/browser/src/apis/data.js - About 1 hr to fix

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

          render() {
              const {
                  isShowingNestedColumns,
                  nestedSearchableColumns,
                  searchableColumns: searchCols,
      Severity: Minor
      Found in packages/browser/src/components/DataBrowser/GlobalSearch.js - About 1 hr to fix

        Function getSampleData has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const getSampleData = properties => {
            const data = {};
            Object.keys(properties).forEach(item => {
                if (META_FIELDS.indexOf(item) === -1) {
                    switch (properties[item].type) {
        Severity: Minor
        Found in packages/browser/src/utils/sampleData.js - About 1 hr to fix

          Function addMapping has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const addMapping = async (
              indexName,
              typeName,
              rawUrl,
              field,
          Severity: Minor
          Found in packages/browser/src/apis/mappings.js - About 1 hr to fix

            Function getAnalyzersApi has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const getAnalyzersApi = 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 1 hr to fix

              Function putSettings has 35 lines of code (exceeds 25 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 1 hr to fix

                Function closeApp has 34 lines of code (exceeds 25 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 1 hr to fix

                  Function openApp has 34 lines of code (exceeds 25 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 1 hr to fix

                    Function data has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const data = (state = initialState, action) => {
                        const { type } = action;
                        const { reactiveListKey } = state;
                        switch (type) {
                            case DATA.ADD_DATA_REQUEST:
                    Severity: Minor
                    Found in packages/browser/src/reducers/data.js - About 1 hr to fix

                      Function search has 32 lines of code (exceeds 25 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 1 hr to fix

                        Function getSortableColumns has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const getSortableColumns = properties => {
                            const columns = [];
                            const sortableTypes = getSortableTypes();
                        
                            if (properties) {
                        Severity: Minor
                        Found in packages/browser/src/utils/mappings.js - About 1 hr to fix

                          Function bulkUpdate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export const bulkUpdate = async (
                              rawUrl,
                              indexName,
                              typeName,
                              queryData,
                          Severity: Minor
                          Found in packages/browser/src/apis/data.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 getCount has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const getCount = async (app, type, rawUrl, version) => {
                              const defaultError = 'Unable to get count';
                              try {
                                  const { url } = parseUrl(rawUrl);
                                  const headers = getHeaders(rawUrl);
                          Severity: Minor
                          Found in packages/browser/src/apis/count.js - About 1 hr to fix

                            Function fetchMappings has 28 lines of code (exceeds 25 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 1 hr to fix

                              Function getAnalyzersApi has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const getAnalyzersApi = 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 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 app has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const app = (state = initialState, action) => {
                                  const { appname, url, type, headers } = action;
                                  switch (type) {
                                      case APP.CONNECT_REQUEST:
                                          return {
                              Severity: Minor
                              Found in packages/browser/src/reducers/app.js - About 1 hr to fix

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

                                    render() {
                                        const { isConnected } = this.props;
                                        const { url, isProcessingUrl } = this.state;
                                
                                        return (
                                Severity: Minor
                                Found in packages/dejavu-main/app/src/components/QueryExplorer.js - About 1 hr to fix

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

                                      render() {
                                          const { isShowingDetails } = this.state;
                                          const { description, handleReload } = this.props;
                                          return (
                                              <Fragment>
                                  Severity: Minor
                                  Found in packages/browser/src/components/ErrorFlashMessage/ErrorMessage.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language