spherehq/sphere

View on GitHub

Showing 27 of 214 total issues

File types.ts has 2348 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export type Maybe<T> = T | null
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string
String: string
Severity: Major
Found in packages/api/src/types.ts - About 6 days to fix

    File schema.ts has 953 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Observable } from 'graphql-typed-client'
     
    export interface Query {
    posts: (Post | null)[]
    post: Post | null
    Severity: Major
    Found in packages/api/client/generated/schema.ts - About 2 days to fix

      Function __generator has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
      Open

      function(thisArg, body) {
      var _ = {
      label: 0,
      sent: function() {
      if (t[0] & 1) throw t[1]
      Severity: Minor
      Found in packages/database/hooks/handler.js - About 1 day to fix

      File index.tsx has 540 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import * as React from 'react'
       
      import { styled } from '@spherehq/geometry/Theme'
      import { Container } from '@spherehq/geometry/Components/Container'
      import { Box } from '@spherehq/geometry/Components/Box'
      Severity: Major
      Found in packages/platform/src/pages/index.tsx - About 1 day to fix

        Function verifySphere has 184 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.verifySphere = function(event) {
        return __awaiter(void 0, void 0, void 0, function() {
        var verificationRule,
        metascraper,
        data,
        Severity: Major
        Found in packages/database/hooks/handler.js - About 7 hrs to fix

          Function verifySphere has 123 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const verifySphere: Handler = async (event: APIGatewayEvent) => {
          const verificationRule = () => {
          const rules = {
          verification: [
          ({ htmlDom: $ }) => {
          Severity: Major
          Found in packages/database/hooks/handler.ts - About 4 hrs to fix

            File handler.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            'use strict'
            var __assign =
            (this && this.__assign) ||
            function() {
            __assign =
            Severity: Minor
            Found in packages/database/hooks/handler.js - About 4 hrs to fix

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

              function(thisArg, body) {
              var _ = {
              label: 0,
              sent: function() {
              if (t[0] & 1) throw t[1]
              Severity: Major
              Found in packages/database/hooks/handler.js - About 3 hrs to fix

                Function ExchangeTokenResolver has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const ExchangeTokenResolver = async (
                _,
                args: { input: ExchangeTokenInput },
                context: ServerContext,
                ) => {
                Severity: Major
                Found in packages/api/src/modules/account/resolvers/Mutation/ExchangeToken.ts - About 2 hrs to fix

                  Function step has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function step(op) {
                  if (f) throw new TypeError('Generator is already executing.')
                  while (_)
                  try {
                  if (
                  Severity: Major
                  Found in packages/database/hooks/handler.js - About 2 hrs to fix

                    Function VerifySphereResolver has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const VerifySphereResolver = async (
                    _,
                    args: { input: VerifySphereInput },
                    context: ServerContext,
                    ) => {
                    Severity: Minor
                    Found in packages/api/src/modules/account/resolvers/Mutation/VerifySphere.ts - About 1 hr to fix

                      Function Search has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const Search = () => {
                      const [value, setValue] = React.useState('')
                      const searchInput = React.createRef<HTMLInputElement>()
                       
                      const onClear = (e: React.SyntheticEvent<HTMLButtonElement>) => {
                      Severity: Minor
                      Found in packages/platform/src/components/Search/Search.tsx - About 1 hr to fix

                        Function fragmentWithArgs has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const fragmentWithArgs = info => {
                        const fields = graphqlFields(info)
                        const fieldsWithArgs = graphqlFields(info, {}, { processArguments: true })
                         
                        let fragmentStr = `{`
                        Severity: Minor
                        Found in packages/api/src/utils/index.ts - About 1 hr to fix

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

                          const recursive = (fields, fieldsWithArgs) => {
                          Object.keys(fields).forEach(field => {
                          if (Object.keys(fields[field]).length > 0) {
                          if (
                          Object.keys(fieldsWithArgs[field]).filter(
                          Severity: Minor
                          Found in packages/api/src/utils/index.ts - About 1 hr to fix

                            Function __awaiter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function(thisArg, _arguments, P, generator) {
                            function adopt(value) {
                            return value instanceof P
                            ? value
                            : new P(function(resolve) {
                            Severity: Minor
                            Found in packages/database/hooks/handler.js - About 1 hr to fix

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

                              export const ExchangeTokenResolver = async (
                              _,
                              args: { input: ExchangeTokenInput },
                              context: ServerContext,
                              ) => {

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

                              export const fragmentWithArgs = info => {
                              const fields = graphqlFields(info)
                              const fieldsWithArgs = graphqlFields(info, {}, { processArguments: true })
                               
                              let fragmentStr = `{`
                              Severity: Minor
                              Found in packages/api/src/utils/index.ts - About 55 mins to fix

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

                              export const VerifySphereResolver = async (
                              _,
                              args: { input: VerifySphereInput },
                              context: ServerContext,
                              ) => {
                              Severity: Minor
                              Found in packages/api/src/modules/account/resolvers/Mutation/VerifySphere.ts - About 55 mins to fix

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

                              context: async ({ req }) => {
                              const context: ServerContext = { db: prisma }
                               
                              if (req.headers.authorization) {
                              const bearer = req.headers.authorization.split(' ')[1] || ''
                              Severity: Minor
                              Found in packages/api/src/server.ts - About 35 mins to fix

                              Avoid too many return statements within this function.
                              Open

                              return [
                              4,
                              prisma_client_1.prisma.upsertPost({
                              where: { url: data.sphereVerification.node.url },
                              create: __assign(__assign({}, post()), {
                              Severity: Major
                              Found in packages/database/hooks/handler.js - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language