igara/syonet_seven

View on GitHub

Showing 49 of 138 total issues

Avoid too many return statements within this function.
Open

      return Promise.all(
        items.map(async (item) => {
          return apiGatewayManagementApi
            .postToConnection({
              ConnectionId: item.id,
Severity: Major
Found in nodejs/websocket/ssb/src/lambda.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return { message: "no event." };
    Severity: Major
    Found in nodejs/websocket/ssb/src/lambda.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return Promise.all(
              items.map(async (item) => {
                return apiGatewayManagementApi
                  .postToConnection({
                    ConnectionId: item.id,
      Severity: Major
      Found in nodejs/websocket/ssb/src/lambda.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return Promise.all(
                items.map(async (item) => {
                  return apiGatewayManagementApi
                    .postToConnection({
                      ConnectionId: item.id,
        Severity: Major
        Found in nodejs/websocket/ssb/src/lambda.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return false;
          Severity: Major
          Found in nodejs/api/src/models/typeorm/helper.ts - About 30 mins to fix

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

            export const SidebarComponent = () => {
              const states = useSelector((state: AppState) => state);
              const dispatch = useDispatch();
            
              return (
            Severity: Minor
            Found in nodejs/www/components/common/sidebar.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

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

            export const authenticate = (req: any, res: any) =>
              new Promise((resolve, reject) => {
                passport.authenticate("jwt", (err, payload) => {
                  if (err) reject(err);
                  if (!payload) reject("not payload");
            Severity: Minor
            Found in nodejs/api/src/passport/jwt.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 getServerSideProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export const getServerSideProps = wrapper.getServerSideProps(async context => {
              let name = context.query.name;
              name = name ? name.toString() : "";
              await context.store.dispatch<any>(getEntry.action(encodeURI(name)));
              const state: AppState = context.store.getState();
            Severity: Minor
            Found in nodejs/www/pages/blogs/hatena/[name].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

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

            export const getServerSideProps = wrapper.getServerSideProps(async context => {
              let name = context.query.name;
              name = name ? name.toString() : "";
              await context.store.dispatch<any>(getItem.action(encodeURI(name)));
              const state: AppState = context.store.getState();
            Severity: Minor
            Found in nodejs/www/pages/blogs/qiita/[name].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