AndrewWalsh/at-your-service

View on GitHub

Showing 28 of 89 total issues

Function Requester has 326 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Requester() {
  const worker = useMemo<SetupWorker>(() => setupWorker(), []);
  const [reqEditorVal, setReqEditorVal] = useState(
    prettyPrintJSON(reqEditorDefaultVal)
  );
Severity: Major
Found in demo/src/Requester.tsx - About 1 day to fix

    Function App has 209 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function App() {
      const { width } = useWindowSize();
      return (
        <Box
          width="100%"
    Severity: Major
    Found in demo/src/App.tsx - About 1 day to fix

      Function storeStructToOpenApi has 119 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const storeStructToOpenApi: StoreStructToOpenApi = async (store) => {
        const spec: OpenApiBuilder = OpenApiBuilder.create();
        // The library assumes 3.0.0, but the generated spec is 3.1.0
        spec.rootDoc.openapi = "3.1.0";
      
      
      Severity: Major
      Found in src/lib/store-struct-to-openapi.ts - About 4 hrs to fix

        Function HowItWorks has 96 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function HowItWorks() {
          const { width } = useWindowSize();
        
          const isLargeScreen = width && width > 600;
          const flexFlow = isLargeScreen ? "row nowrap" : "column nowrap";
        Severity: Major
        Found in demo/src/HowItWorks.tsx - About 3 hrs to fix

          Function getResponse has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          async function getResponse(event, client, requestId) {
            const beforeRequestTime = Date.now()
            const { request } = event
            const clonedRequest = request.clone()
          
          
          Severity: Major
          Found in demo/public/mockServiceWorker.js - About 2 hrs to fix

            Function Title has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function Title() {
              return (
                <Heading as="h1" margin="32px 0" maxWidth="850px">
                  <br />
                  <Link
            Severity: Major
            Found in demo/src/Title.tsx - About 2 hrs to fix

              Function getResponse has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              async function getResponse(event, client, requestId) {
                const beforeRequestTime = Date.now()
                const { request } = event
                const clonedRequest = request.clone()
              
              
              Severity: Major
              Found in docs/mockServiceWorker.js - About 2 hrs to fix

                Function update has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  async update(message: Message): Promise<void> {
                    const data = message.get();
                    const status = `s${data.response.status}`;
                    const url = new URL(data.request.url);
                    const { pathToStoreRoute, pathname } = Store.getPathToStoreRoute({
                Severity: Major
                Found in src/data-types/store/message-store.ts - About 2 hrs to fix

                  Function RenderBox has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const RenderBox = (props: Item) => {
                    const height = `${Math.max(props.height, MIN_DIMENSION)}px`;
                    const width = `${Math.max(props.width, MIN_DIMENSION)}px`;
                    const bgs: Array<string> = [
                      COLOR_WHITE,
                  Severity: Major
                  Found in demo/src/AnimationEffect.tsx - About 2 hrs to fix

                    Function AnimationEffect has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function AnimationEffect(props: {
                      bg: typeof COLOR_PRIMARY | typeof COLOR_SECONDARY;
                    }) {
                      const [itemsFirst, setItemsFirst] = useState<Array<Item>>([]);
                    
                    
                    Severity: Major
                    Found in demo/src/AnimationEffect.tsx - About 2 hrs to fix

                      Function createStoreStructureAndExpectedForSingleMessage has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const createStoreStructureAndExpectedForSingleMessage = async (
                        message = createMessage()
                      ): Promise<CreateStoreStructureAndExpectedForSingleMessageReturns> => {
                        const data = message.get();
                        const url = new URL(data.request.url);
                      Severity: Minor
                      Found in src/data-types/store/message-store.test.ts - About 1 hr to fix

                        Function LatencySlider has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function LatencySlider(props: Props) {
                          const sliderValue = props.value;
                          const setSliderValue = props.setValue;
                          const [showTooltip, setShowTooltip] = useState(false);
                          return (
                        Severity: Minor
                        Found in demo/src/LatencySlider.tsx - About 1 hr to fix

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

                            async _createPayload(event, response, beforeRequestTime, afterRequestTime, requestBody) {
                              const request = event.request
                              const requestHeaders = {};
                              for (const [key, value] of request.headers) {
                                requestHeaders[key] = value;
                          Severity: Minor
                          Found in demo/public/mockServiceWorker.js - About 1 hr to fix

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

                              async _createPayload(event, response, beforeRequestTime, afterRequestTime, requestBody) {
                                const request = event.request
                                const requestHeaders = {};
                                for (const [key, value] of request.headers) {
                                  requestHeaders[key] = value;
                            Severity: Minor
                            Found in demo/public/at-your-service-sw.js - About 1 hr to fix

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

                                async _createPayload(event, response, beforeRequestTime, afterRequestTime, requestBody) {
                                  const request = event.request
                                  const requestHeaders = {};
                                  for (const [key, value] of request.headers) {
                                    requestHeaders[key] = value;
                              Severity: Minor
                              Found in docs/mockServiceWorker.js - About 1 hr to fix

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

                                  async _createPayload(event, response, beforeRequestTime, afterRequestTime, requestBody) {
                                    const request = event.request
                                    const requestHeaders = {};
                                    for (const [key, value] of request.headers) {
                                      requestHeaders[key] = value;
                                Severity: Minor
                                Found in docs/at-your-service-sw.js - About 1 hr to fix

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

                                  export default function SkeletonLanding() {
                                    const [isLoaded, setIsLoaded] = useState(false);
                                    return (
                                      <Stack padding={4} spacing={1} width="300px">
                                        <Skeleton
                                  Severity: Minor
                                  Found in demo/src/SkeletonLanding.tsx - About 1 hr to fix

                                    Function onClickMockRequest has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      const onClickMockRequest = async (e: MouseEvent<HTMLButtonElement>) => {
                                        e.preventDefault();
                                        if (!worker) {
                                          return;
                                        }
                                    Severity: Minor
                                    Found in demo/src/Requester.tsx - About 1 hr to fix

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

                                        async _createPayload(request, response, beforeRequestTime, afterRequestTime) {
                                          const requestHeaders = {};
                                          for (const [key, value] of request.headers) {
                                            requestHeaders[key] = value;
                                          }
                                      Severity: Minor
                                      Found in src/_not_exported/at-your-service-sw.js - About 1 hr to fix

                                        Function App has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export default function App() {
                                          const [open, setOpen] = useState(false);
                                          const [storeStruct, setStoreStruct] = useState<StoreStructure | null>(null);
                                          const { store } = useContext(Ctx);
                                        
                                        
                                        Severity: Minor
                                        Found in src/ui/App.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language