EMSL-MSC/pacifica-reporting

View on GitHub

Showing 259 of 259 total issues

File jsgrid.js has 1961 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jsGrid v1.5.3 (http://js-grid.com)
 * (c) 2016 Artem Tabalin
 * Licensed under MIT (https://github.com/tabalinas/jsgrid/blob/master/LICENSE)
 */
Severity: Major
Found in application/resources/scripts/jsgrid/jsgrid.js - About 5 days to fix

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

    var generate_month_select_options = function(parent_obj, min_date, max_date, selected_year, selected_month){
        var today = moment();
        if(!selected_year){
            selected_year = today.year();
        }
    Severity: Major
    Found in application/resources/scripts/activity_report.js and 1 other location - About 2 days to fix
    application/resources/scripts/compliance.js on lines 207..244

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

    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

    var generate_month_select_options = function(parent_obj, min_date, max_date, selected_year, selected_month){
        var today = moment();
        if(!selected_year){
            selected_year = today.year();
        }
    Severity: Major
    Found in application/resources/scripts/compliance.js and 1 other location - About 2 days to fix
    application/resources/scripts/activity_report.js on lines 162..199

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

    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 IRI.php has 835 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * IRI parser/serialiser/normaliser
     *
     * @package Requests
    Severity: Major
    Found in application/third_party/Requests-1.7.0/library/Requests/IRI.php - About 2 days to fix

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

      (function(jsGrid) {
      
          jsGrid.locales.he = {
              grid: {
                  noDataContent: "לא נמצא",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-he.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.es = {
              grid: {
                  noDataContent: "No encontrado",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-es.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.ja = {
              grid: {
                  noDataContent: "データが見つかりません。",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-ja.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

      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

      (function(jsGrid) {
      
          jsGrid.locales["zh-cn"] = {
              grid: {
                  noDataContent: "暂无数据",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-zh-cn.js and 2 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-pt-br.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-zh-tw.js on lines 1..46

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

      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

      (function(jsGrid) {
      
          jsGrid.locales["pt-br"] = {
              grid: {
                  noDataContent: "Não encontrado",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-pt-br.js and 2 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-zh-cn.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-zh-tw.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.pt = {
              grid: {
                  noDataContent: "Não encontrado",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-pt.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

      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

      (function(jsGrid) {
      
          jsGrid.locales["zh-tw"] = {
              grid: {
                  noDataContent: "暫無資料",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-zh-tw.js and 2 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-pt-br.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-zh-cn.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.pl = {
              grid: {
                  noDataContent: "Nie znaleziono",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-pl.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.ka = {
              grid: {
                  noDataContent: "მონაცემები ცარიელია.",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-ka.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.fr = {
              grid: {
                  noDataContent: "Pas de données",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-fr.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.ru = {
              grid: {
                  noDataContent: "Данных не найдено",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-ru.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.tr = {
              grid: {
                  noDataContent: "Kayıt Bulunamadı",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-tr.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-de.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46

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

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

      (function(jsGrid) {
      
          jsGrid.locales.de = {
              grid: {
                  noDataContent: "Die Daten konnten nicht gefunden werden",
      Severity: Major
      Found in application/resources/scripts/jsgrid/i18n/jsgrid-de.js and 9 other locations - About 1 day to fix
      application/resources/scripts/jsgrid/i18n/jsgrid-es.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-fr.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-he.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ja.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ka.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-pl.js on lines 1..62
      application/resources/scripts/jsgrid/i18n/jsgrid-pt.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-ru.js on lines 1..46
      application/resources/scripts/jsgrid/i18n/jsgrid-tr.js on lines 1..46

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

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

          public function request($url, $headers = array(), $data = array(), $options = array()) {
              $options['hooks']->dispatch('fsockopen.before_request');
      
              $url_parts = parse_url($url);
              $host = $url_parts['host'];

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

          protected function remove_iunreserved_percent_encoded($match)
          {
              // As we just have valid percent encoded sequences we can just explode
              // and ignore the first member of the returned array (an empty string).
              $bytes = explode('%', $match[0]);
      Severity: Minor
      Found in application/third_party/Requests-1.7.0/library/Requests/IRI.php - About 7 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

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

      var generate_year_select_options = function(parent_obj, min_date, max_date, selected_year){
          var today = moment();
          var min_date_obj = moment(min_date);
          // var max_date_obj = moment(max_date);
          var min_year = min_date_obj.year();
      Severity: Major
      Found in application/resources/scripts/compliance.js and 1 other location - About 7 hrs to fix
      application/resources/scripts/activity_report.js on lines 139..160

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

      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