Showing 529 of 529 total issues

Function pdfjsWrapper has a Cognitive Complexity of 1973 (exceeds 5 allowed). Consider refactoring.
Open

(function pdfjsWrapper() {
  // Use strict in our context only - users might not want it
  'use strict';

/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
Severity: Minor
Found in public/mozilla-pdf/core/pdf.js - About 1 mo 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

Function pdfjsWrapper has 5257 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function pdfjsWrapper() {
  // Use strict in our context only - users might not want it
  'use strict';

/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
Severity: Major
Found in public/mozilla-pdf/core/pdf.js - About 3 wks to fix

    File pdf.js has 5275 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
    /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
    /* Copyright 2012 Mozilla Foundation
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
    Severity: Major
    Found in public/mozilla-pdf/core/pdf.js - About 2 wks to fix

      File viewer.js has 4599 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
      /* Copyright 2012 Mozilla Foundation
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
      Severity: Major
      Found in public/mozilla-pdf/web/viewer.js - About 1 wk to fix

        Function webL10n has a Cognitive Complexity of 367 (exceeds 5 allowed). Consider refactoring.
        Open

        document.webL10n = (function(window, document, undefined) {
          var gL10nData = {};
          var gTextData = '';
          var gTextProp = 'textContent';
          var gLanguage = '';
        Severity: Minor
        Found in public/mozilla-pdf/web/l10n.js - About 1 wk 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

        Function CanvasGraphicsClosure has 1391 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var CanvasGraphics = (function CanvasGraphicsClosure() {
          // Defines the time the executeOperatorList is going to be executing
          // before it stops and shedules a continue of execution.
          var EXECUTION_TIME = 15;
        
        
        Severity: Major
        Found in public/mozilla-pdf/core/pdf.js - About 6 days to fix

          File en-US.js has 2332 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          if (window.i18n == undefined) window.i18n = {};
          // Generated by CoffeeScript 1.3.3
          (function() {
          
            i18n.date = {
          Severity: Major
          Found in app/assets/javascripts/i18n/locale/en-US.js - About 6 days to fix

            Function webL10n has 776 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            document.webL10n = (function(window, document, undefined) {
              var gL10nData = {};
              var gTextData = '';
              var gTextProp = 'textContent';
              var gLanguage = '';
            Severity: Major
            Found in public/mozilla-pdf/web/l10n.js - About 3 days to fix

              File de-CH.js has 1218 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              if (window.i18n == undefined) window.i18n = {};
              // Generated by CoffeeScript 1.3.3
              (function() {
              
                i18n.date = {
              Severity: Major
              Found in app/assets/javascripts/i18n/locale/de-CH.js - About 3 days to fix

                File en-GB.js has 1174 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                if (window.i18n == undefined) window.i18n = {};
                // Generated by CoffeeScript 1.3.3
                (function() {
                
                  i18n.date = {
                Severity: Major
                Found in app/assets/javascripts/i18n/locale/en-GB.js - About 3 days to fix

                  Method hash_for_media_resource has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def hash_for_media_resource(media_resource, with = nil)
                        h = {
                          id: media_resource.id,
                          created_at: media_resource.created_at.iso8601,
                          updated_at: media_resource.updated_at.iso8601,
                  Severity: Minor
                  Found in app/helpers/json/media_resource_helper.rb - About 2 days 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

                  Function pageView has 544 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var PageView = function pageView(container, id, scale,
                                                   navigateTo, defaultViewport) {
                    this.id = id;
                  
                    this.rotation = 0;
                  Severity: Major
                  Found in public/mozilla-pdf/web/viewer.js - About 2 days to fix

                    Function pageView has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var PageView = function pageView(container, id, scale,
                                                     navigateTo, defaultViewport) {
                      this.id = id;
                    
                      this.rotation = 0;
                    Severity: Minor
                    Found in public/mozilla-pdf/web/viewer.js - About 2 days 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

                    File gsw-CH.js has 875 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    if (window.i18n == undefined) window.i18n = {};
                    // Generated by CoffeeScript 1.3.3
                    (function() {
                    
                      i18n.date = {
                    Severity: Major
                    Found in app/assets/javascripts/i18n/locale/gsw-CH.js - About 2 days to fix

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

                      (function() {
                      
                        i18n.date = {
                          L: "DD.MM.YYYY",
                          XL: "dddd DD.MM.YYYY",
                      Severity: Major
                      Found in app/assets/javascripts/i18n/locale/de-CH.js and 1 other location - About 2 days to fix
                      app/assets/javascripts/i18n/formats/de-CH.js on lines 2..68

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

                      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

                      (function() {
                      
                        i18n.date = {
                          L: "DD.MM.YYYY",
                          XL: "dddd DD.MM.YYYY",
                      Severity: Major
                      Found in app/assets/javascripts/i18n/formats/de-CH.js and 1 other location - About 2 days to fix
                      app/assets/javascripts/i18n/locale/de-CH.js on lines 3..69

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

                      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 textLayerBuilder has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
                      Open

                      var TextLayerBuilder = function textLayerBuilder(options) {
                        var textLayerFrag = document.createDocumentFragment();
                      
                        this.textLayerDiv = options.textLayerDiv;
                        this.layoutDone = false;
                      Severity: Minor
                      Found in public/mozilla-pdf/web/viewer.js - About 2 days 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 6 locations. Consider refactoring.
                      Open

                      (function() {
                      
                        i18n.date = {
                          L: "MM/DD/YYYY",
                          XL: "dddd MM/DD/YYYY",
                      Severity: Major
                      Found in app/assets/javascripts/i18n/formats/en-US.js and 5 other locations - About 1 day to fix
                      app/assets/javascripts/i18n/formats/en-GB.js on lines 2..66
                      app/assets/javascripts/i18n/formats/gsw-CH.js on lines 2..66
                      app/assets/javascripts/i18n/locale/en-GB.js on lines 3..67
                      app/assets/javascripts/i18n/locale/en-US.js on lines 3..67
                      app/assets/javascripts/i18n/locale/gsw-CH.js on lines 3..67

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

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

                      (function() {
                      
                        i18n.date = {
                          L: "MM/DD/YYYY",
                          XL: "dddd MM/DD/YYYY",
                      Severity: Major
                      Found in app/assets/javascripts/i18n/locale/en-US.js and 5 other locations - About 1 day to fix
                      app/assets/javascripts/i18n/formats/en-GB.js on lines 2..66
                      app/assets/javascripts/i18n/formats/en-US.js on lines 2..66
                      app/assets/javascripts/i18n/formats/gsw-CH.js on lines 2..66
                      app/assets/javascripts/i18n/locale/en-GB.js on lines 3..67
                      app/assets/javascripts/i18n/locale/gsw-CH.js on lines 3..67

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

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

                      (function() {
                      
                        i18n.date = {
                          L: "DD.MM.YYYY",
                          XL: "dddd DD.MM.YYYY",
                      Severity: Major
                      Found in app/assets/javascripts/i18n/formats/gsw-CH.js and 5 other locations - About 1 day to fix
                      app/assets/javascripts/i18n/formats/en-GB.js on lines 2..66
                      app/assets/javascripts/i18n/formats/en-US.js on lines 2..66
                      app/assets/javascripts/i18n/locale/en-GB.js on lines 3..67
                      app/assets/javascripts/i18n/locale/en-US.js on lines 3..67
                      app/assets/javascripts/i18n/locale/gsw-CH.js on lines 3..67

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

                      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