symphonyoss/hubot-symphony

View on GitHub

Showing 122 of 122 total issues

Function constructor has 301 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(args: ConstructorArgsType) {
    super();

    this.messages = [];
    this.host = args.host;
Severity: Major
Found in test/nock-server.js - About 1 day to fix

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

        symphony.createRoom(roomInfo)
          .then((response) => {
            assert.equal('foo', response.roomAttributes.name);
            assert.equal('bar', response.roomAttributes.description);
            assert.deepEqual([{key: 'x', value: 'y'}], response.roomAttributes.keywords);
    Severity: Major
    Found in test/symphony-test.js and 2 other locations - About 1 day to fix
    test/symphony-test.js on lines 272..286
    test/symphony-test.js on lines 301..315

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

    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 3 locations. Consider refactoring.
    Open

        symphony.getRoomInfo(nock.streamId)
          .then((response) => {
            assert.equal('foo', response.roomAttributes.name);
            assert.equal('bar', response.roomAttributes.description);
            assert.deepEqual([{key: 'x', value: 'y'}], response.roomAttributes.keywords);
    Severity: Major
    Found in test/symphony-test.js and 2 other locations - About 1 day to fix
    test/symphony-test.js on lines 251..265
    test/symphony-test.js on lines 301..315

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

    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 3 locations. Consider refactoring.
    Open

        symphony.updateRoom(nock.streamId, roomInfo)
          .then((response) => {
            assert.equal('foo1', response.roomAttributes.name);
            assert.equal('bar2', response.roomAttributes.description);
            assert.deepEqual([{key: 'x', value: 'y3'}], response.roomAttributes.keywords);
    Severity: Major
    Found in test/symphony-test.js and 2 other locations - About 1 day to fix
    test/symphony-test.js on lines 251..265
    test/symphony-test.js on lines 272..286

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

    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

      it('should reply with @mention', (done) => {
        let robot = new FakeRobot();
        let adapter = SymphonyAdapter.use(robot);
        adapter.on('connected', () => {
          assert.isDefined(adapter.symphony);
    Severity: Major
    Found in test/adapter-test.js and 1 other location - About 7 hrs to fix
    test/adapter-test.js on lines 164..184

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

    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

      it('should escape xml chars in reply', (done) => {
        let robot = new FakeRobot();
        let adapter = SymphonyAdapter.use(robot);
        adapter.on('connected', () => {
          assert.isDefined(adapter.symphony);
    Severity: Major
    Found in test/adapter-test.js and 1 other location - About 7 hrs to fix
    test/adapter-test.js on lines 142..162

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

    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 3 locations. Consider refactoring.
    Open

      it('should send direct message to username', (done) => {
        let robot = new FakeRobot();
        let adapter = SymphonyAdapter.use(robot);
        adapter.on('connected', () => {
          assert.isDefined(adapter.symphony);
    Severity: Major
    Found in test/adapter-test.js and 2 other locations - About 6 hrs to fix
    test/adapter-test.js on lines 211..224
    test/adapter-test.js on lines 226..239

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

    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 3 locations. Consider refactoring.
    Open

      it('should send direct message to id', (done) => {
        let robot = new FakeRobot();
        let adapter = SymphonyAdapter.use(robot);
        adapter.on('connected', () => {
          assert.isDefined(adapter.symphony);
    Severity: Major
    Found in test/adapter-test.js and 2 other locations - About 6 hrs to fix
    test/adapter-test.js on lines 196..209
    test/adapter-test.js on lines 211..224

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

    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 3 locations. Consider refactoring.
    Open

      it('should send direct message to email', (done) => {
        let robot = new FakeRobot();
        let adapter = SymphonyAdapter.use(robot);
        adapter.on('connected', () => {
          assert.isDefined(adapter.symphony);
    Severity: Major
    Found in test/adapter-test.js and 2 other locations - About 6 hrs to fix
    test/adapter-test.js on lines 196..209
    test/adapter-test.js on lines 226..239

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

    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

    File symphony.js has 407 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     *    Copyright 2017 Jon Freedman
     *
     *    Licensed under the Apache License, Version 2.0 (the "License");
     *    you may not use this file except in compliance with the License.
    Severity: Minor
    Found in src/symphony.js - About 5 hrs to fix

      File symphony-test.js has 397 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       *    Copyright 2017 Jon Freedman
       *
       *    Licensed under the Apache License, Version 2.0 (the "License");
       *    you may not use this file except in compliance with the License.
      Severity: Minor
      Found in test/symphony-test.js - About 5 hrs to fix

        File nock-server.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         *    Copyright 2017 Jon Freedman
         *
         *    Licensed under the Apache License, Version 2.0 (the "License");
         *    you may not use this file except in compliance with the License.
        Severity: Minor
        Found in test/nock-server.js - About 5 hrs to fix

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

            sendDirectMessageToEmail(email: string, ...messages: Array<MessageTypeOrString>) {
              this.robot.logger.debug(`Sending direct message to email: ${email}`);
              this._userLookup({emailAddress: email}, undefined)
                .then((response) => {
                  this.sendDirectMessageToUserId(response.id, ...messages);
          Severity: Major
          Found in src/adapter.js and 1 other location - About 3 hrs to fix
          src/adapter.js on lines 181..187

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

          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

            sendDirectMessageToUsername(username: string, ...messages: Array<MessageTypeOrString>) {
              this.robot.logger.debug(`Sending direct message to username: ${username}`);
              this._userLookup({username: username}, undefined)
                .then((response) => {
                  this.sendDirectMessageToUserId(response.id, ...messages);
          Severity: Major
          Found in src/adapter.js and 1 other location - About 3 hrs to fix
          src/adapter.js on lines 202..208

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

          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

            it('echo should obtain session and key tokens and echo response', (done) => {
              const msg = {message: 'bar'};
              symphony.echo(msg)
                .then((response) => {
                  assert.deepEqual(msg, response);
          Severity: Major
          Found in test/symphony-test.js and 1 other location - About 3 hrs to fix
          test/symphony-test.js on lines 53..63

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

          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

            it('should connect to separate key manager / agent url', (done) => {
              const msg = {message: 'bar'};
              symphony.echo(msg)
                .then((response) => {
                  assert.deepEqual(msg, response);
          Severity: Major
          Found in test/symphony-test.js and 1 other location - About 3 hrs to fix
          test/symphony-test.js on lines 95..105

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

          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

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

              adapter.on('connected', () => {
                assert.isDefined(adapter.symphony);
                robot.on('received', () => {
                  assert.include(robot.received.map((m) => m.text), 'Hello World');
                  adapter.close();
          Severity: Major
          Found in test/adapter-test.js and 1 other location - About 3 hrs to fix
          test/adapter-test.js on lines 56..63

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

          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

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

              adapter.on('connected', () => {
                assert.isDefined(adapter.symphony);
                robot.on('received', () => {
                  assert.include(robot.received.map((m) => m.text), 'Hello World');
                  adapter.close();
          Severity: Major
          Found in test/adapter-test.js and 1 other location - About 3 hrs to fix
          test/adapter-test.js on lines 88..95

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

          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

          Symphony has 26 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Symphony {
            host: string;
            keyManagerHost: string;
            sessionAuthHost: string;
            agentHost: string;
          Severity: Minor
          Found in src/symphony.js - About 3 hrs to fix

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

              it('should connect to separate pod url', (done) => {
                symphony.whoAmI()
                  .then((response) => {
                    assert.equal(nock.botUserId, response.userId);
                    done();
            Severity: Major
            Found in test/symphony-test.js and 2 other locations - About 2 hrs to fix
            test/symphony-test.js on lines 107..116
            test/symphony-test.js on lines 168..177

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

            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