EscolaLMS/sdk

View on GitHub

Showing 59 of 336 total issues

Function h5pProgress has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  apiUrl: string,
  topicId: number,
  statementId: string,
  statement: API.IStatement,
  token: string
Severity: Minor
Found in src/services/courses.ts - About 35 mins to fix

    Function bookConsultationDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      apiUrl: string,
      token: string,
      id: number,
      term: string,
      options?: RequestOptionsInit
    Severity: Minor
    Found in src/services/consultations.ts - About 35 mins to fix

      Function generateJitsy has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        apiUrl: string,
        token: string,
        id: number,
        term: string,
        options?: RequestOptionsInit
      Severity: Minor
      Found in src/services/consultations.ts - About 35 mins to fix

        Function updateBookmarkNote has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          apiUrl: string,
          token: string,
          id: number,
          body: API.CreateBookmarkNote,
          options?: RequestOptionsInit
        Severity: Minor
        Found in src/services/bookmarks_notes.ts - About 35 mins to fix

          Function updateConsultationAccess has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            apiUrl: string,
            token: string,
            id: number,
            body: API.ConsultationsAccessEnquiryUpdateRequest,
            options?: RequestOptionsInit
          Severity: Minor
          Found in src/services/consultations_access.ts - About 35 mins to fix

            Function getQuestionnaireStars has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              apiUrl: string,
              modelTypeTitle: string,
              modelID: number,
              id: number,
              options?: RequestOptionsInit
            Severity: Minor
            Found in src/services/questionnaire.ts - About 35 mins to fix

              Function addToCart has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                apiUrl: string,
                productId: number,
                token?: string,
                quantity?: number,
                options?: RequestOptionsInit
              Severity: Minor
              Found in src/services/cart.ts - About 35 mins to fix

                Function payWithP24 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  apiUrl: string,
                  email: string,
                  return_url: string,
                  token: string,
                  data?: API.InvoiceData
                Severity: Minor
                Found in src/services/cart.ts - About 35 mins to fix

                  Function attachProduct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    apiUrl: string,
                    productableId: number,
                    productableType: string,
                    token?: string | null,
                    options?: RequestOptionsInit
                  Severity: Minor
                  Found in src/services/products.ts - About 35 mins to fix

                    Function getQuestionnairesAnswer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      apiUrl: string,
                      modelTypeTitle: string,
                      modelID: number,
                      id: number,
                      params?: API.PaginationParams
                    Severity: Minor
                    Found in src/services/questionnaire.ts - About 35 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return;
                      Severity: Major
                      Found in src/react/context/states.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                  return response;
                        Severity: Major
                        Found in src/react/context/states.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return response;
                          Severity: Major
                          Found in src/react/context/states.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              return undefined;
                            Severity: Major
                            Found in src/react/context/states.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return error;
                              Severity: Major
                              Found in src/react/context/states.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return null;
                                Severity: Major
                                Found in src/react/context/index.tsx - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return error;
                                  Severity: Major
                                  Found in src/react/context/states.ts - About 30 mins to fix

                                    Function useLocalStorage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export function useLocalStorage<T>(
                                      storeKey: string,
                                      key: string,
                                      initialValue: T,
                                      ssrHydration: boolean = false
                                    Severity: Minor
                                    Found in src/react/hooks/useLocalStorage.ts - 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 TasksContextProvider has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    > = ({ children, defaults, apiUrl, ssrHydration }) => {
                                      const abortControllers = useRef<Record<string, AbortController | null>>({});
                                    
                                      const { token } = useContext(UserContext);
                                    
                                    
                                    Severity: Minor
                                    Found in src/react/context/tasks.tsx - 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