igara/syonet_seven

View on GitHub

Showing 138 of 138 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const getItem = createAsync("THUNKS_BLOGS_QIITA_GET_ITEM", async (name: string) => {
  try {
    const item = await callItem(name);
    return item;
  } catch (error) {
Severity: Major
Found in nodejs/www/actions/blogs/qiita/item.ts and 1 other location - About 1 hr to fix
nodejs/www/actions/blogs/hatena/entry.ts on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const getEntry = createAsync("THUNKS_BLOGS_HATENA_GET_ENTRY", async (name: string) => {
  try {
    const item = await callEntry(name);
    return item;
  } catch (error) {
Severity: Major
Found in nodejs/www/actions/blogs/hatena/entry.ts and 1 other location - About 1 hr to fix
nodejs/www/actions/blogs/qiita/item.ts on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  @Mutation(() => CreateWebPushUser, { nullable: true })
  async createWebPushUser(
    @Arg("endpoint") endpoint: string,
    @Arg("auth") auth: string,
    @Arg("p256dh") p256dh: string
Severity: Minor
Found in nodejs/api/src/resolvers/webpush.ts - About 1 hr to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    export type AuthState = {
      id: number;
      snsID: string;
      username: string;
      imageURL: string;
    Severity: Major
    Found in nodejs/www/states/common/auth.ts and 1 other location - About 1 hr to fix
    nodejs/www/libs/apollo/gql/auth.ts on lines 4..11

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    const ToolsScrapingPageComponent = () => {
      const state = useSelector((state: AppState) => state);
      const dispatch = useDispatch();
    
      const [url, setURL] = useState("");
    Severity: Minor
    Found in nodejs/www/pages/tools/scraping.tsx - 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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      checkAuth: {
        id: number;
        snsID: string;
        username: string;
        imageURL: string;
    Severity: Major
    Found in nodejs/www/libs/apollo/gql/auth.ts and 1 other location - About 1 hr to fix
    nodejs/www/states/common/auth.ts on lines 4..11

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 60.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    export const getDecks = createAsync("THUNKS_BLOGS_SPEAKERDECK_GET_DECKS", async () => {
      try {
        const json = await callDecks();
        return json;
      } catch (error) {
    Severity: Major
    Found in nodejs/www/actions/blogs/speakerdeck/decks.ts and 3 other locations - About 1 hr to fix
    nodejs/www/actions/blogs/hatena/entries.ts on lines 12..19
    nodejs/www/actions/blogs/jinsei.ts on lines 12..19
    nodejs/www/actions/blogs/qiita/items.ts on lines 12..19

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 55.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      const dynamodb = process.env.IS_OFFLINE
        ? new AWS.DynamoDB.DocumentClient({
            region: "localhost",
            endpoint: "http://localhost:5000",
          })
    Severity: Major
    Found in nodejs/websocket/ssb/src/lambda.ts and 1 other location - About 1 hr to fix
    nodejs/websocket/ssb/src/lambda.ts on lines 268..273

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 55.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    export const getItems = createAsync("THUNKS_BLOGS_QIITA_GET_ITEMS", async () => {
      try {
        const json = await callItems();
        return json;
      } catch (error) {
    Severity: Major
    Found in nodejs/www/actions/blogs/qiita/items.ts and 3 other locations - About 1 hr to fix
    nodejs/www/actions/blogs/hatena/entries.ts on lines 12..19
    nodejs/www/actions/blogs/jinsei.ts on lines 12..19
    nodejs/www/actions/blogs/speakerdeck/decks.ts on lines 12..19

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 55.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    export const getEntries = createAsync("THUNKS_BLOGS_HATENA_GET_ENTRIES", async () => {
      try {
        const json = await callEntries();
        return json;
      } catch (error) {
    Severity: Major
    Found in nodejs/www/actions/blogs/hatena/entries.ts and 3 other locations - About 1 hr to fix
    nodejs/www/actions/blogs/jinsei.ts on lines 12..19
    nodejs/www/actions/blogs/qiita/items.ts on lines 12..19
    nodejs/www/actions/blogs/speakerdeck/decks.ts on lines 12..19

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 55.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    export const getJinsei = createAsync("THUNKS_BLOGS_JINSEI_GET_JINSEI", async () => {
      try {
        const jinsei = await callJinsei();
        return jinsei;
      } catch (error) {
    Severity: Major
    Found in nodejs/www/actions/blogs/jinsei.ts and 3 other locations - About 1 hr to fix
    nodejs/www/actions/blogs/hatena/entries.ts on lines 12..19
    nodejs/www/actions/blogs/qiita/items.ts on lines 12..19
    nodejs/www/actions/blogs/speakerdeck/decks.ts on lines 12..19

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 55.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      const dynamodb = process.env.IS_OFFLINE
        ? new AWS.DynamoDB.DocumentClient({
            region: "localhost",
            endpoint: "http://localhost:5000",
          })
    Severity: Major
    Found in nodejs/websocket/ssb/src/lambda.ts and 1 other location - About 1 hr to fix
    nodejs/websocket/ssb/src/lambda.ts on lines 71..76

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 55.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    export const termReducer = reducerWithInitialState(initialState)
      /**
       * 利用規約を押下したときの処理
       */
      .case(termActions.onClickOpen, state => {
    Severity: Minor
    Found in nodejs/www/states/common/term.ts and 1 other location - About 55 mins to fix
    nodejs/www/states/common/sidebar.ts on lines 16..28

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    export const sidebarReducer = reducerWithInitialState(initialState)
      /**
       * LinkIconを押下したときの処理
       */
      .case(footerActions.onClickLinkIcon, state => {
    Severity: Minor
    Found in nodejs/www/states/common/sidebar.ts and 1 other location - About 55 mins to fix
    nodejs/www/states/common/term.ts on lines 15..27

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 54.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      useEffect(() => {
        if (process.browser) {
          (async () => {
            await requestWebpush();
            await loadCheckAuth();
    Severity: Major
    Found in nodejs/www/pages/tools/ssb.tsx and 6 other locations - About 50 mins to fix
    nodejs/www/pages/_error.tsx on lines 23..30
    nodejs/www/pages/blogs/index.tsx on lines 32..39
    nodejs/www/pages/login/index.tsx on lines 33..40
    nodejs/www/pages/tools/index.tsx on lines 31..38
    nodejs/www/pages/tools/scraping.tsx on lines 66..73
    nodejs/www/pages/tools/sound/index.tsx on lines 126..133

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      useEffect(() => {
        if (process.browser) {
          (async () => {
            await requestWebpush();
            await loadCheckAuth();
    Severity: Major
    Found in nodejs/www/pages/tools/sound/index.tsx and 6 other locations - About 50 mins to fix
    nodejs/www/pages/_error.tsx on lines 23..30
    nodejs/www/pages/blogs/index.tsx on lines 32..39
    nodejs/www/pages/login/index.tsx on lines 33..40
    nodejs/www/pages/tools/index.tsx on lines 31..38
    nodejs/www/pages/tools/scraping.tsx on lines 66..73
    nodejs/www/pages/tools/ssb.tsx on lines 31..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      useEffect(() => {
        if (process.browser) {
          (async () => {
            await requestWebpush();
            await loadCheckAuth();
    Severity: Major
    Found in nodejs/www/pages/_error.tsx and 6 other locations - About 50 mins to fix
    nodejs/www/pages/blogs/index.tsx on lines 32..39
    nodejs/www/pages/login/index.tsx on lines 33..40
    nodejs/www/pages/tools/index.tsx on lines 31..38
    nodejs/www/pages/tools/scraping.tsx on lines 66..73
    nodejs/www/pages/tools/sound/index.tsx on lines 126..133
    nodejs/www/pages/tools/ssb.tsx on lines 31..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      useEffect(() => {
        if (process.browser) {
          (async () => {
            await requestWebpush();
            await loadCheckAuth();
    Severity: Major
    Found in nodejs/www/pages/blogs/index.tsx and 6 other locations - About 50 mins to fix
    nodejs/www/pages/_error.tsx on lines 23..30
    nodejs/www/pages/login/index.tsx on lines 33..40
    nodejs/www/pages/tools/index.tsx on lines 31..38
    nodejs/www/pages/tools/scraping.tsx on lines 66..73
    nodejs/www/pages/tools/sound/index.tsx on lines 126..133
    nodejs/www/pages/tools/ssb.tsx on lines 31..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      useEffect(() => {
        if (process.browser) {
          (async () => {
            await requestWebpush();
            await loadCheckAuth();
    Severity: Major
    Found in nodejs/www/pages/login/index.tsx and 6 other locations - About 50 mins to fix
    nodejs/www/pages/_error.tsx on lines 23..30
    nodejs/www/pages/blogs/index.tsx on lines 32..39
    nodejs/www/pages/tools/index.tsx on lines 31..38
    nodejs/www/pages/tools/scraping.tsx on lines 66..73
    nodejs/www/pages/tools/sound/index.tsx on lines 126..133
    nodejs/www/pages/tools/ssb.tsx on lines 31..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      useEffect(() => {
        if (process.browser) {
          (async () => {
            await requestWebpush();
            await loadCheckAuth();
    Severity: Major
    Found in nodejs/www/pages/tools/scraping.tsx and 6 other locations - About 50 mins to fix
    nodejs/www/pages/_error.tsx on lines 23..30
    nodejs/www/pages/blogs/index.tsx on lines 32..39
    nodejs/www/pages/login/index.tsx on lines 33..40
    nodejs/www/pages/tools/index.tsx on lines 31..38
    nodejs/www/pages/tools/sound/index.tsx on lines 126..133
    nodejs/www/pages/tools/ssb.tsx on lines 31..38

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language