dodekeract/manta-config-engine-app

View on GitHub

Showing 108 of 108 total issues

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

    componentDidMount: function () {
        var that = this;
        $.getJSON('cycles/' + this.state.id + '.json', function (data) {
            that.setState({
                description: data.description,
Severity: Major
Found in source/web/components/cycle.jsx and 1 other location - About 3 hrs to fix
source/web/components/chatwheel.jsx on lines 18..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 99.

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

    componentDidMount: function () {
        var that = this;
        $.getJSON('chatwheels/' + this.state.id + '.json', function (data) {
            that.setState({
                description: data.description,
Severity: Major
Found in source/web/components/chatwheel.jsx and 1 other location - About 3 hrs to fix
source/web/components/cycle.jsx on lines 16..26

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

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="jumbotron header">
                    <div className="container">
                        <h1>Extensions</h1>
                        <p>Import chatwheels, cycles and layouts other people shared.</p>
                        <a className="btn btn-success" href="https://github.com/dodekeract/manta-config-engine/blob/master/extensions/">
Severity: Major
Found in source/web/components/extensions/view.jsx and 1 other location - About 3 hrs to fix
source/web/components/presets.jsx on lines 15..23

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

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

                <div className="jumbotron header">
                    <div className="container">
                        <h1>Presets</h1>
                        <p>Shows your configuration in JSON. Also allows you to import and export presets.</p>
                        <a className="btn btn-success" href="https://github.com/dodekeract/manta-config-engine/blob/master/presets/">
Severity: Major
Found in source/web/components/presets.jsx and 1 other location - About 3 hrs to fix
source/web/components/extensions/view.jsx on lines 14..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 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

Function render has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    render: function () {
        var properties = window.matchSetting[this.props.domain][this.props.id];
        var tip = properties.info ? (
                <i className="glyphicon glyphicon-question-sign" data-tip data-multiline={true} data-for={this.props.uniqueID}/>
            ) : '';
Severity: Minor
Found in source/web/components/settings-panel.jsx - About 3 hrs 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

actions has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

var actions = {
    loadKeyboardLayout: function () {
        dispatcher.dispatch({
            type: constants.LOAD_KEYBOARD_LAYOUT
        });
Severity: Minor
Found in source/web/actions.js - About 2 hrs to fix

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

                                <div className="media">
                                    <div className="media-left media-middle">
                                        <img src="images/osx.svg" width="56"/>
                                    </div>
                                    <div className="media-body">
    Severity: Major
    Found in source/web/components/home.jsx and 1 other location - About 2 hrs to fix
    source/web/components/home.jsx on lines 77..85

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

    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="media">
                                    <div className="media-left media-middle">
                                        <img src="images/ubuntu.svg" width="56"/>
                                    </div>
                                    <div className="media-body">
    Severity: Major
    Found in source/web/components/home.jsx and 1 other location - About 2 hrs to fix
    source/web/components/home.jsx on lines 68..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 89.

    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: function () {
            var cycles = [];
            var cy = this.state.preset.cycles;
            for (var i = 0; i < cy.length; i++) {
                if (cy.length % 2 === 0 || i < cy.length - 1) {
    Severity: Major
    Found in source/web/components/cycles/view.jsx - About 2 hrs to fix

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

      gulp.task('copy-chatwheels', function () {
          return gulp.src(path.chatwheels, {
                  base: path.baseExtensions
              })
              .pipe(fileList('chatwheels.json', {
      Severity: Major
      Found in source/gulpfile.js and 3 other locations - About 2 hrs to fix
      source/gulpfile.js on lines 74..83
      source/gulpfile.js on lines 85..94
      source/gulpfile.js on lines 107..116

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

      gulp.task('copy-presets', function () {
          return gulp.src(path.presets, {
                  base: path.basePresets
              })
              .pipe(fileList('presets.json', {
      Severity: Major
      Found in source/gulpfile.js and 3 other locations - About 2 hrs to fix
      source/gulpfile.js on lines 85..94
      source/gulpfile.js on lines 96..105
      source/gulpfile.js on lines 107..116

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

      gulp.task('copy-cycles', function () {
          return gulp.src(path.cycles, {
                  base: path.baseExtensions
              })
              .pipe(fileList('cycles.json', {
      Severity: Major
      Found in source/gulpfile.js and 3 other locations - About 2 hrs to fix
      source/gulpfile.js on lines 74..83
      source/gulpfile.js on lines 96..105
      source/gulpfile.js on lines 107..116

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

      gulp.task('copy-layouts', function () {
          return gulp.src(path.layouts, {
                  base: path.baseExtensions
              })
              .pipe(fileList('layouts.json', {
      Severity: Major
      Found in source/gulpfile.js and 3 other locations - About 2 hrs to fix
      source/gulpfile.js on lines 74..83
      source/gulpfile.js on lines 85..94
      source/gulpfile.js on lines 96..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 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

      Function renderConfigure has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          renderConfigure: function () {
              var state = this.props.state;
              var subView = viewData[state.changer.view];
              var content = [];
              subView.options.forEach(function (item, index) {
      Severity: Major
      Found in source/web/components/dialogs/bind-changer.jsx - About 2 hrs to fix

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

                        <div className="jumbotron header">
                            <div className="container">
                                <h1>Game Settings</h1>
                                <p>Adjust the game's look &amp; feel to your needs. Especially useful when multiple people use the same PC.</p>
                                <a className="btn btn-success" href="https://github.com/dodekeract/manta-config-engine-app/wiki/Settings">View Documentation</a>
        Severity: Major
        Found in source/web/components/settings.jsx and 1 other location - About 2 hrs to fix
        source/web/components/custom-code.jsx on lines 17..25

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

        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="jumbotron header">
                            <div className="container">
                                <h1>Custom Code</h1>
                                <p>
                                    Add your own autoexec code directly to Manta.
        Severity: Major
        Found in source/web/components/custom-code.jsx and 1 other location - About 2 hrs to fix
        source/web/components/settings.jsx on lines 5..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 84.

        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 main.jsx has 264 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // external
        
        var manta = require('dota2-manta-config-engine');
        
        // internal
        Severity: Minor
        Found in source/web/main.jsx - About 2 hrs to fix

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

                  case constants.LOAD_CHATWHEEL:
                      $.getJSON('chatwheels/' + action.id + '.json', function (data) {
                          _state.preset.chatwheels.push(data.phrases);
                          location.href = '#/chatwheels';
                          store.emitChange();
          Severity: Major
          Found in source/web/store.js and 1 other location - About 2 hrs to fix
          source/web/store.js on lines 89..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 76.

          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

                  case constants.LOAD_CYCLE:
                      $.getJSON('cycles/' + action.id + '.json', function (data) {
                          _state.preset.cycles.push(data.actions);
                          location.href = '#/cycles';
                          store.emitChange();
          Severity: Major
          Found in source/web/store.js and 1 other location - About 2 hrs to fix
          source/web/store.js on lines 97..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 76.

          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

                                  <div className="modal-header">
                                      <button type="button" className="close" data-dismiss="modal"><span>&times;</span></button>
                                      <h4 className="modal-title">Changes Since Your Last Visit</h4>
                                  </div>
          Severity: Major
          Found in source/web/components/dialogs/changelog.jsx and 2 other locations - About 1 hr to fix
          source/web/components/dialogs/confirm-delete.jsx on lines 17..20
          source/web/components/dialogs/error.jsx on lines 17..20

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

          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