Dalphi/dalphi

View on GitHub

Showing 1,441 of 1,441 total issues

Loofah 2.1.1 is vulnerable (CVE-2018-8048). Upgrade to 2.1.2
Open

    loofah (2.1.1)
Severity: Minor
Found in Gemfile.lock by brakeman

Avoid too many return statements within this method.
Open

    return action_label(token) if is_action?(token)
Severity: Major
Found in app/helpers/breadcrumb_bakery.rb - About 30 mins to fix

    rails-html-sanitizer 1.0.3 is vulnerable (CVE-2018-3741). Upgrade to 1.0.4
    Open

        rails-html-sanitizer (1.0.3)
    Severity: Minor
    Found in Gemfile.lock by brakeman

    Block has too many lines. [27/25]
    Open

      it 'patches a raw_datum' do
        project = FactoryGirl.create(:project)
        raw_datum = FactoryGirl.create(:raw_datum, project: project)
        raw_datum.data = File.new("#{Rails.root}/spec/fixtures/text/valid1.md")
        raw_datum.save!

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [27/25]
    Open

      it 'patches a statistic' do
        project = FactoryGirl.create(:project)
        statistic = FactoryGirl.create(:statistic, project: project)
        expect(Statistic.count).to eq(1)
    
    

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

        it 'should not be assigned twice for non disjunct sets of problem identifiers' do
          @interface.title = 'Duplicate title'
          @interface.associated_problem_identifiers = %w(ner superNER)
          @interface.save!
    
    
    Severity: Minor
    Found in spec/models/interface_spec.rb and 2 other locations - About 30 mins to fix
    spec/models/interface_spec.rb on lines 45..54
    spec/models/interface_spec.rb on lines 57..66

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

    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

        it 'can be assigned twice for disjunct sets of problem identifiers' do
          @interface.title = 'Duplicate title'
          @interface.associated_problem_identifiers = %w(ner superNER)
          @interface.save!
    
    
    Severity: Minor
    Found in spec/models/interface_spec.rb and 2 other locations - About 30 mins to fix
    spec/models/interface_spec.rb on lines 33..42
    spec/models/interface_spec.rb on lines 57..66

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

    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

        it 'can be different for non disjunct sets of problem identifiers' do
          @interface.title = 'Different title'
          @interface.associated_problem_identifiers = %w(ner superNER)
          @interface.save!
    
    
    Severity: Minor
    Found in spec/models/interface_spec.rb and 2 other locations - About 30 mins to fix
    spec/models/interface_spec.rb on lines 33..42
    spec/models/interface_spec.rb on lines 45..54

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

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

        def process_iteration_data(raw_data)
          @annotation_documents = false
          iterate_service = @project.iterate_service
          response = json_post_request iterate_service.url,
                                       process_iteration_data_response_hash(raw_data)
    Severity: Minor
    Found in app/controllers/projects_controller.rb - About 25 mins 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

    Method create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def create
            ActionController::Parameters.permit_all_parameters = true
            annotation_documents = []
            annotation_documents_params.each do |ad_params|
              @annotation_document = AnnotationDocument.new(ad_params)
    Severity: Minor
    Found in app/controllers/api/v1/annotation_documents_controller.rb - About 25 mins 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 2 locations. Consider refactoring.
    Open

          def update
            if @statistic.update(statistic_params)
              render json: @statistic.relevant_attributes
            else
              render status: 400,
    Severity: Minor
    Found in app/controllers/api/v1/statistics_controller.rb and 1 other location - About 25 mins to fix
    app/controllers/api/v1/annotation_documents_controller.rb on lines 185..196

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

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

      def self.process_zip_archive(project, zip, temp_dir)
        require 'zip'
        batch_result = { success: [], error: [] }
        Zip::File.open(zip) do |zipfile|
          zipfile.each do |file|
    Severity: Minor
    Found in app/models/raw_datum.rb - About 25 mins 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

    Method batch_process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.batch_process(project, data)
        return { error: [], success: [] } unless data || data == []
        data_size = data.size
        data_first = data.first.tempfile
        if data_size == 1 && valid_zip?(data_first)
    Severity: Minor
    Found in app/models/raw_datum.rb - About 25 mins 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 2 locations. Consider refactoring.
    Open

          def update
            if @annotation_document.update(converted_annotation_document_params)
              render json: @annotation_document.relevant_attributes
            else
              render status: 400,
    Severity: Minor
    Found in app/controllers/api/v1/annotation_documents_controller.rb and 1 other location - About 25 mins to fix
    app/controllers/api/v1/statistics_controller.rb on lines 179..190

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

    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

        it 'can be nil or empty iff stylesheet is nil' do
          @interface.stylesheet = nil
          @interface.compiled_stylesheet = nil
          expect(@interface).to be_valid
    
    
    Severity: Minor
    Found in spec/models/interface_spec.rb and 1 other location - About 25 mins to fix
    spec/models/interface_spec.rb on lines 215..222

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

    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

        it 'can be nil or empty iff java_script is nil' do
          @interface.java_script = nil
          @interface.compiled_java_script = nil
          expect(@interface).to be_valid
    
    
    Severity: Minor
    Found in spec/models/interface_spec.rb and 1 other location - About 25 mins to fix
    spec/models/interface_spec.rb on lines 150..157

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

    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

    Block has too many lines. [26/25]
    Open

      describe 'connect_services' do
        it 'should not connect services if no service available' do
          Service.destroy_all
          @project.connect_services
          expect(@project.iterate_service).to eq(nil)
    Severity: Minor
    Found in spec/models/project_spec.rb by rubocop

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [26/25]
    Open

      it 'associates newly created statistic with the right project from raw_data ids' do
        raw_datum = FactoryGirl.create(:raw_datum)
        project = raw_datum.project
        statistic = FactoryGirl.build(:statistic, project: project)
        expect(Statistic.count).to eq(0)

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [26/25]
    Open

      describe 'convert_interface_types' do
        it 'should return [] for nil argument' do
          expect(InterfaceType.convert_interface_types(nil)).to eq([])
        end
    
    
    Severity: Minor
    Found in spec/models/interface_type_spec.rb by rubocop

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Block has too many lines. [26/25]
    Open

        it 'creates one raw_datum for a singleton' do
          project = FactoryGirl.create(:project)
          raw_datum = FactoryGirl.build(:raw_datum, project: project)
          expect(RawDatum.count).to eq(0)
    
    

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

    Severity
    Category
    Status
    Source
    Language