KanCraft/kanColleWidget

View on GitHub

Showing 165 of 165 total issues

Function render has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render(): JSX.Element {
    const { settings, selected, preview, row, col, page } = this.props;
    return (
      <div className="container sidebar">
        <div className="form-group">
Severity: Major
Found in src/js/Applications/Components/DeckCapture/SideBar.tsx - About 2 hrs to fix

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

    export async function OnMissionResult() {
      const service = new NotificationService();
      const notes = await service.getAll();
      Object.entries(notes).map(async ([nid]) => {
        if (nid.startsWith(Mission.__ns)) await service.clear(nid);
    src/js/Applications/Background/Controllers/Request/Shipbuilding.ts on lines 27..33

    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 91.

    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 async function OnShipbuildingGetShip() {
      const service = new NotificationService();
      const notes = await service.getAll();
      Object.entries(notes).map(async ([nid]) => {
        if (nid.startsWith(Shipbuilding.__ns)) await service.clear(nid);
    src/js/Applications/Background/Controllers/Request/Mission.ts on lines 38..44

    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 91.

    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

                      <div className={cn("tooltip tooltip-right", { "selected": this.state.tool == Rect })} data-tooltip="矩形">
                        <FontAwesomeIcon className="c-hand"
                          icon={faSquareFull}
                          onClick={() => this.setState({ tool: Rect })}
                        />
    Severity: Major
    Found in src/js/Applications/Components/Capture/index.tsx and 1 other location - About 2 hrs to fix
    src/js/Applications/Components/Capture/index.tsx on lines 110..115

    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 91.

    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

                      <div className={cn("tooltip tooltip-right", {"selected": this.state.tool == Crop})} data-tooltip="切り取り">
                        <FontAwesomeIcon className="c-hand"
                          icon={faCut}
                          onClick={() => this.setState({ tool: Crop })}
                        />
    Severity: Major
    Found in src/js/Applications/Components/Capture/index.tsx and 1 other location - About 2 hrs to fix
    src/js/Applications/Components/Capture/index.tsx on lines 116..121

    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 91.

    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 render has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const {active, controllers, body} = this.state;
        return (
          <section>
            <h2>Controller Simulator</h2>
    Severity: Major
    Found in src/js/Applications/Components/Options/Debugger/Simulator.tsx - About 2 hrs to fix

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

        start(id: number): QuestProgress {
          if (!this.quests[id]) return this; // TODO: なんかする
          this.quests[id].status = Status.Ongoing;
          return this.update({ quests: { ...this.quests } });
        }
      Severity: Major
      Found in src/js/Applications/Models/Quest/index.ts and 1 other location - About 2 hrs to fix
      src/js/Applications/Models/Quest/index.ts on lines 111..115

      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 88.

      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

        stop(id: number): QuestProgress {
          if (!this.quests[id]) return this; // TODO: なんかする
          this.quests[id].status = Status.Open;
          return this.update({ quests: { ...this.quests } });
        }
      Severity: Major
      Found in src/js/Applications/Models/Quest/index.ts and 1 other location - About 2 hrs to fix
      src/js/Applications/Models/Quest/index.ts on lines 106..110

      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 88.

      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 render has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const frame = this.props.frame || Frame.new({ size: { width: 800, height: 640 }, position: { left: 0, top: 0 } });
          const isAddMode = this.props.frame == null;
          const editMode = isAddMode || this.state.editMode;
          return (
      Severity: Major
      Found in src/js/Applications/Components/Options/Frames/index.tsx - About 2 hrs to fix

        File missions.ts has 276 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const catalog: {
          [id: number]: {
            title: string;
            time: number; // ミリ秒
          };
        Severity: Minor
        Found in src/js/Applications/Models/Queue/missions.ts - About 2 hrs to fix

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

          export async function OnShipbuildingStart(req: DebuggableRequest) {
            const { formData: { api_kdock_id: [dock], api_highspeed: [highspeed] } } = req.requestBody;
            tmp.dock = highspeed === "1" ? null : parseInt(dock, 10);
            return { status: 200 };
          }
          src/js/Applications/Background/Controllers/Request/Recovery.ts on lines 17..21

          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 87.

          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 async function OnRecoveryStart(req: DebuggableRequest) {
            const { formData: { api_ndock_id: [dock], api_highspeed: [highspeed] } } = req.requestBody;
            tmp.dock = highspeed === "1" ? null : parseInt(dock, 10);
            return {status: 200};
          }
          src/js/Applications/Background/Controllers/Request/Shipbuilding.ts on lines 18..22

          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 87.

          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

            try {
              await fs.stat("./config/dev/firebase.json");
              console.log("[INFO]", "./config/dev/firebase.json を発見しました。");
            } catch {
              console.log("[INFO]", "./config/dev/firebase.json が見つかりません。");
          Severity: Major
          Found in scripts/postinstall.ts and 1 other location - About 2 hrs to fix
          scripts/postinstall.ts on lines 16..24

          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 86.

          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

            try {
              await fs.stat("./config/dev/twitter.json");
              console.log("[INFO]", "./config/dev/twitter.json を発見しました。");
            } catch {
              console.log("[INFO]", "./config/dev/twitter.json が見つかりません。");
          Severity: Major
          Found in scripts/postinstall.ts and 1 other location - About 2 hrs to fix
          scripts/postinstall.ts on lines 7..15

          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 86.

          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 render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const { setting } = this.state;
              return (
                <section className="category screenshot-setting">
                  <h1>スクショ設定</h1>
          Severity: Major
          Found in src/js/Applications/Components/Options/Screenshot/index.tsx - About 2 hrs to fix

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

                } else {
                  this.context.strokeRect(
                    this.start.x, this.start.y,
                    this.end.x - this.start.x, this.end.y - this.start.y
                  );
            Severity: Major
            Found in src/js/Applications/Components/Capture/Tools/Rect.ts and 1 other location - About 2 hrs to fix
            src/js/Applications/Components/Capture/Tools/Rect.ts on lines 32..37

            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 77.

            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

              4: {
                title: "西方海域",
                maps: {
                  1: {
                    title: "ジャム島沖",
            Severity: Major
            Found in src/js/Applications/Models/Sortie/catalog.ts and 3 other locations - About 2 hrs to fix
            src/js/Applications/Models/Sortie/catalog.ts on lines 41..61
            src/js/Applications/Models/Sortie/catalog.ts on lines 62..82
            src/js/Applications/Models/Sortie/catalog.ts on lines 124..144

            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 77.

            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

              3: {
                title: "北方海域",
                maps: {
                  1: {
                    title: "モーレイ海",
            Severity: Major
            Found in src/js/Applications/Models/Sortie/catalog.ts and 3 other locations - About 2 hrs to fix
            src/js/Applications/Models/Sortie/catalog.ts on lines 41..61
            src/js/Applications/Models/Sortie/catalog.ts on lines 83..103
            src/js/Applications/Models/Sortie/catalog.ts on lines 124..144

            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 77.

            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

                if (this.fill) {
                  this.context.fillRect(
                    this.start.x, this.start.y,
                    this.end.x - this.start.x, this.end.y - this.start.y
                  );
            Severity: Major
            Found in src/js/Applications/Components/Capture/Tools/Rect.ts and 1 other location - About 2 hrs to fix
            src/js/Applications/Components/Capture/Tools/Rect.ts on lines 37..42

            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 77.

            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

              6: {
                title: "南部海域",
                maps: {
                  1: {
                    title: "中部海域哨戒線",
            Severity: Major
            Found in src/js/Applications/Models/Sortie/catalog.ts and 3 other locations - About 2 hrs to fix
            src/js/Applications/Models/Sortie/catalog.ts on lines 41..61
            src/js/Applications/Models/Sortie/catalog.ts on lines 62..82
            src/js/Applications/Models/Sortie/catalog.ts on lines 83..103

            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 77.

            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