wikimedia/wikimedia-fundraising-dash

View on GitHub

Showing 93 of 93 total issues

Function filterText has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        self.filterText = ko.computed( function () {
            var filterName,
                text,
                parts = [],
                choices = self.userChoices(),
Severity: Minor
Found in src/app/widgetBase.js - About 1 hr to fix

    Function validateValue has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    function validateValue( value, column ) {
        var valid = false,
            i;
        switch ( column.type ) {
            case 'dropdown':
    Severity: Minor
    Found in routes/data.js - 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

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

                    case timePresets[ 3 ]:
                        lfvm = new Date( currentDate.getTime() - ( 5 * 60 * 1000 ) );
                        ds += 'DT gt \'' + lfvm.toISOString() + '\'';
                        break;
    Severity: Major
    Found in src/components/widgets/fraud-gauge/fraud-gauge.js and 2 other locations - About 1 hr to fix
    src/components/widgets/fraud-gauge/fraud-gauge.js on lines 169..172
    src/components/widgets/fraud-gauge/fraud-gauge.js on lines 173..176

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

                    case timePresets[ 1 ]:
                        lh = new Date( currentDate.getTime() - ( 60 * 60 * 1000 ) );
                        ds += 'DT gt \'' + lh.toISOString() + '\'';
                        break;
    Severity: Major
    Found in src/components/widgets/fraud-gauge/fraud-gauge.js and 2 other locations - About 1 hr to fix
    src/components/widgets/fraud-gauge/fraud-gauge.js on lines 169..172
    src/components/widgets/fraud-gauge/fraud-gauge.js on lines 181..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 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 3 locations. Consider refactoring.
    Open

                    case timePresets[ 0 ]:
                        lfm = new Date( currentDate.getTime() - ( 15 * 60 * 1000 ) );
                        ds += 'DT gt \'' + lfm.toISOString() + '\'';
                        break;
    Severity: Major
    Found in src/components/widgets/fraud-gauge/fraud-gauge.js and 2 other locations - About 1 hr to fix
    src/components/widgets/fraud-gauge/fraud-gauge.js on lines 173..176
    src/components/widgets/fraud-gauge/fraud-gauge.js on lines 181..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 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 validateValue has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function validateValue( value, column ) {
        var valid = false,
            i;
        switch ( column.type ) {
            case 'dropdown':
    Severity: Minor
    Found in routes/data.js - About 1 hr to fix

      Function TextFilterViewModel has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function TextFilterViewModel( params ) {
              var self = this;
      
              this.operators = [
                  ops.eq,
      Severity: Minor
      Found in src/components/filters/text-filter/text-filter.js - About 1 hr to fix

        Function saveWidgetConfig has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                self.saveWidgetConfig = function () {
                    self.config.userChoices = self.userChoices();
                    self.config.filterQueryString = self.filterQueryString();
        
                    var data = JSON.stringify( {
        Severity: Minor
        Found in src/app/widgetBase.js - About 1 hr to fix

          Function NumberFilterViewModel has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function NumberFilterViewModel( params ) {
                  var self = this;
          
                  this.operators = [
                      ops.eq,
          Severity: Minor
          Found in src/components/filters/number-filter/number-filter.js - About 1 hr to fix

            Function addBoard has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    self.addBoard = function () {
                        var board, name = self.newBoardName();
                        self.boardError( '' );
                        if ( name === '' ) {
                            self.boardError( 'Enter new board name' );
            Severity: Minor
            Found in src/components/nav-bar/nav-bar.js - About 1 hr to fix

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

                  shim: {
                      bootstrap: {
                          deps: [
                              'jquery'
                          ]
              Severity: Major
              Found in src/app/require.config.js and 1 other location - About 1 hr to fix
              app.build.js on lines 29..48

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

              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

                  shim: {
                      bootstrap: {
                          deps: [
                              'jquery'
                          ]
              Severity: Major
              Found in app.build.js and 1 other location - About 1 hr to fix
              src/app/require.config.js on lines 28..47

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

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

                      self.reloadData = function ( automatic ) {
                          // FIXME: use some common filter logic
                          var qs = '$filter=' + self.campaign().getDateFilter() + ' and ' +
                                  'Amount lt \'' + self.majorDonationCutoff() + '\'',
                              interval = 500000,
              Severity: Minor
              Found in src/components/widgets/totals-earned-chart/totals-earned-chart.js - About 1 hr to fix

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

                    mysqlPromise.configure( {
                        host: config.dbserver,
                        user: config.dblogin,
                        password: config.dbpwd,
                        database: config.db,
                Severity: Minor
                Found in routes/data.js and 1 other location - About 55 mins to fix
                persistence.js on lines 6..12

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

                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

                    promiseDb.configure( {
                        host: config.userDbServer,
                        user: config.userDbLogin,
                        password: config.userDbPwd,
                        database: config.userDb,
                Severity: Minor
                Found in persistence.js and 1 other location - About 55 mins to fix
                routes/data.js on lines 375..381

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

                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

                        IsEndowment: {
                            table: 'ft',
                            column: 'name',
                            func: 'case WHEN [[COL]] = \'Endowment Gift\' then 1 else 0 end',
                            display: 'Is Endowment',
                Severity: Minor
                Found in widgets/common-filters.js and 1 other location - About 50 mins to fix
                widgets/common-filters.js on lines 87..96

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

                        IsRecurring: {
                            table: 'cc',
                            column: 'contribution_recur_id',
                            func: 'isnull([[COL]])',
                            display: 'Is Recurring',
                Severity: Minor
                Found in widgets/common-filters.js and 1 other location - About 50 mins to fix
                widgets/common-filters.js on lines 291..300

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

                        Gateway: {
                            table: 'pi',
                            column: 'gateway',
                            display: 'Gateway',
                            type: 'dropdown',
                Severity: Minor
                Found in widgets/common-filters.js and 1 other location - About 45 mins to fix
                widgets/common-filters.js on lines 273..280

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

                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

                        Gateway: {
                            table: 'cx',
                            column: 'gateway',
                            display: 'Gateway',
                            type: 'dropdown',
                Severity: Minor
                Found in widgets/common-filters.js and 1 other location - About 45 mins to fix
                widgets/common-filters.js on lines 154..161

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

                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

                gulp.task( 'font', [ 'clean' ], function () {
                    return gulp.src( [ 'src/bower_modules/lato/font/*{ttf,woff,eot,svg}' ] )
                        .pipe( gulp.dest( './dist/font/' ) );
                } );
                Severity: Minor
                Found in gulpfile.js and 1 other location - About 40 mins to fix
                gulpfile.js on lines 109..112

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

                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