marano/bgirlz

View on GitHub

Showing 46 of 46 total issues

File bootstrap.js has 1251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.1.1
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
Severity: Major
Found in public/bootstrap/js/bootstrap.js - About 3 days to fix

    File spec.rb has 432 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require_relative 'spec_helper'
    
    describe 'Black Girls Code Website Publisher', :js => true do
    
      it 'publishes my website and show me info bar with site address' do
    Severity: Minor
    Found in spec.rb - About 6 hrs to fix

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

        $('.star-it').click(function (event) {
          event.preventDefault();
          $('.star-it').tooltip('hide');
          var row = getParentRow(event.target);
          var path = row.data('favorite-path');
      Severity: Major
      Found in public/list.js and 1 other location - About 5 hrs to fix
      public/list.js on lines 26..38

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

      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

        $('.starred').click(function (event) {
          event.preventDefault();
          $('.starred').tooltip('hide');
          var row = getParentRow(event.target);
          var path = row.data('unfavorite-path');
      Severity: Major
      Found in public/list.js and 1 other location - About 5 hrs to fix
      public/list.js on lines 12..24

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

      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

      Class Page has 39 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Page
        include MongoMapper::Document
      
        key :name, String
        key :middle_initial, String
      Severity: Minor
      Found in lib/model.rb - About 5 hrs to fix

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

          $('thead').mouseenter(function (event) {
            searchTreeFor('.show-on-header-hover', getParentRow(event.target)).each(function (index, element) {
              $(element).addClass('hovering');
            });
          }).mouseleave(function (event) {
        Severity: Major
        Found in public/list.js and 1 other location - About 4 hrs to fix
        public/list.js on lines 120..128

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

        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

          $('.page').mouseenter(function (event) {
            searchTreeFor('.show-on-hover', getParentRow(event.target)).each(function (index, element) {
              $(element).addClass('hovering');
            });
          }).mouseleave(function (event) {
        Severity: Major
        Found in public/list.js and 1 other location - About 4 hrs to fix
        public/list.js on lines 110..118

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

        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

          $.fn.popover = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('popover')
                , options = typeof option == 'object' && option
        Severity: Major
        Found in public/bootstrap/js/bootstrap.js and 1 other location - About 4 hrs to fix
        public/bootstrap/js/bootstrap.js on lines 1183..1191

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

        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

          $.fn.affix = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('affix')
                , options = typeof option == 'object' && option
        Severity: Major
        Found in public/bootstrap/js/bootstrap.js and 1 other location - About 4 hrs to fix
        public/bootstrap/js/bootstrap.js on lines 1095..1103

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

        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

          $.fn.scrollspy = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('scrollspy')
                , options = typeof option == 'object' && option
        Severity: Major
        Found in public/bootstrap/js/bootstrap.js and 3 other locations - About 4 hrs to fix
        public/bootstrap/js/bootstrap.js on lines 987..995
        public/bootstrap/js/bootstrap.js on lines 1530..1538
        public/bootstrap/js/bootstrap.js on lines 2005..2013

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

        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

          $.fn.typeahead = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('typeahead')
                , options = typeof option == 'object' && option
        Severity: Major
        Found in public/bootstrap/js/bootstrap.js and 3 other locations - About 4 hrs to fix
        public/bootstrap/js/bootstrap.js on lines 573..581
        public/bootstrap/js/bootstrap.js on lines 987..995
        public/bootstrap/js/bootstrap.js on lines 1530..1538

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

        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

          $.fn.tooltip = function ( option ) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('tooltip')
                , options = typeof option == 'object' && option
        Severity: Major
        Found in public/bootstrap/js/bootstrap.js and 3 other locations - About 4 hrs to fix
        public/bootstrap/js/bootstrap.js on lines 573..581
        public/bootstrap/js/bootstrap.js on lines 1530..1538
        public/bootstrap/js/bootstrap.js on lines 2005..2013

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

        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

          $.fn.collapse = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('collapse')
                , options = typeof option == 'object' && option
        Severity: Major
        Found in public/bootstrap/js/bootstrap.js and 3 other locations - About 4 hrs to fix
        public/bootstrap/js/bootstrap.js on lines 573..581
        public/bootstrap/js/bootstrap.js on lines 987..995
        public/bootstrap/js/bootstrap.js on lines 2005..2013

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

        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

          $.fn.dropdown = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('dropdown')
              if (!data) $this.data('dropdown', (data = new Dropdown(this)))
        Severity: Major
        Found in public/bootstrap/js/bootstrap.js and 1 other location - About 3 hrs to fix
        public/bootstrap/js/bootstrap.js on lines 1289..1296

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

        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

          $.fn.alert = function (option) {
            return this.each(function () {
              var $this = $(this)
                , data = $this.data('alert')
              if (!data) $this.data('alert', (data = new Alert(this)))
        Severity: Major
        Found in public/bootstrap/js/bootstrap.js and 1 other location - About 3 hrs to fix
        public/bootstrap/js/bootstrap.js on lines 425..432

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

        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

            eventDiv.find('.event-expand').click(function (event) {
              event.preventDefault();
              var eventDiv = getEventDiv(event.target);
              eventDiv.find('.pages').removeClass('hide');
              eventDiv.find('.event-expand').addClass('hide');
        Severity: Major
        Found in public/list.js and 1 other location - About 3 hrs to fix
        public/list.js on lines 209..215

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

        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

            eventDiv.find('.event-collapse').click(function (event) {
              event.preventDefault();
              var eventDiv = getEventDiv(event.target);
              eventDiv.find('.pages').addClass('hide');
              eventDiv.find('.event-expand').removeClass('hide');
        Severity: Major
        Found in public/list.js and 1 other location - About 3 hrs to fix
        public/list.js on lines 201..207

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

        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

        Method upload_page_and_assert_data_was_saved has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        def upload_page_and_assert_data_was_saved(params, success = true)
          visit '/'
          fill_in 'name', :with => params[:name] if params[:name]
          fill_in 'middle_initial', :with => params[:middle_initial] if params[:middle_initial]
          fill_in 'last_name', :with => params[:last_name] if params[:last_name]
        Severity: Minor
        Found in spec_helper.rb - 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

        File list.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        $(function () {
          $('.delete').click(function (e) {
            var ok = confirm("Are you sure you want to delete that page?");
            if (ok) {
              $(e.target).closest('form').submit();
        Severity: Minor
        Found in public/list.js - About 3 hrs to fix

          Function bindEvents has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function bindEvents(eventDiv) {
              pageCounter(eventDiv);
          
              eventDiv.find('.event-expand').click(function (event) {
                event.preventDefault();
          Severity: Major
          Found in public/list.js - About 3 hrs to fix
            Severity
            Category
            Status
            Source
            Language